本文整理汇总了PHP中_INPUT函数的典型用法代码示例。如果您正苦于以下问题:PHP _INPUT函数的具体用法?PHP _INPUT怎么用?PHP _INPUT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_INPUT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: respond
} else {
return NULL;
}
}
function respond($status, $SESSIONID, $USERNAME, $EXIT = false)
{
echo "<?xml version='1.0' encoding='UTF-8'?><SESSION><STATUS>{$status}</STATUS><SESSIONID>{$SESSIONID}</SESSIONID><USERNAME>{$USERNAME}</USERNAME></SESSION>";
if ($EXIT == true) {
exit;
}
}
// MAIN
if (count($_POST) > 0 or count($_GET) > 0) {
#
// VALIDATE INPUTS
$USERNAME = _INPUT("USERNAME");
if (preg_match("/[^A-Za-z0-9\\_\\-\\.\\@\\,]/", $USERNAME)) {
respond("BADUSER", '', '', true);
}
// CONNECT TO THE DATABASE
$mysqli = new mysqli('cge', 'cgeclient', 'www', 'cge');
// CHECK CONNECTION
if (mysqli_connect_errno()) {
respond("Connect failed: %s\n", mysqli_connect_error(), '', '', true);
}
// CHECK STATUS IS RESET
$stmt = $mysqli->prepare("SELECT tmp, status FROM users WHERE usr = ?");
$stmt->bind_param('s', $USERNAME);
// EXECUTE AND GET RESULTS
$stmt->execute();
$stmt->bind_result($tmp, $stat);
示例2: respond
// IMPORT PHP LIBRARIES
include_once '/srv/www/php-lib/cge_std_tools.php';
// Including CGE_std clases and functions
//////////////////////// MAIN /////////////////////////
if (count($_POST) + count($_GET) > 0 and isset($_SESSION['SESSIONID']) and isset($_SESSION['USERNAME'])) {
// VALIDATE SESSION
$SESSIONID = $_SESSION['SESSIONID'];
$USERNAME = $_SESSION['USERNAME'];
if (preg_match("/[^A-Za-z0-9\\_\\-\\.\\@\\,]/", $USERNAME)) {
respond("BADUSER", '', true);
}
if (preg_match("/[^A-fa-f0-9]/", $SESSIONID)) {
respond("BADSESSION", '', true);
}
// VALIDATE INPUTS
$sid = _INPUT("SID");
if ($sid == '' or $sid == null) {
respond("NOSID", '', true);
}
if (preg_match("/[^0-9]/", $sid)) {
respond("BADSID", array('VALUE' => $sid), true);
}
// CONNECT TO THE DATABASE
$mysqli = new mysqli('cge', 'cgeclient', 'www', 'cge');
// CHECK CONNECTION
if (mysqli_connect_errno()) {
respond("MYSQLERROR", array('MESSAGE' => "Connect failed: %s\n", mysqli_connect_error()), true);
}
// VALIDATE USER AND EXTRACT UID => $status = ACCEPTED or NOUSER or INVALIDSESSION
list($status, $uid) = ValidateUser($mysqli, $USERNAME, $SESSIONID);
// VERIFY SERVICE ACCESS PERMISSIONS => $status = ACCEPTED or NOACCESS or NOSERVICE
示例3: count
}
}
// MAIN
if ((count($_POST) > 0 or count($_GET) > 0) and isset($_SESSION['SESSIONID']) and isset($_SESSION['USERNAME'])) {
# count($_POST)>0 or count($_GET)>0
// VALIDATE SESSION
$SESSIONID = $_SESSION['SESSIONID'];
$USERNAME = $_SESSION['USERNAME'];
if (preg_match("/[^A-Za-z0-9\\_\\-\\.\\@\\,]/", $USERNAME)) {
respond("BADUSER", '', true);
}
if (preg_match("/[^A-fa-f0-9]/", $SESSIONID)) {
respond("BADSESSION", '', true);
}
// VALIDATE INPUTS
$SID = _INPUT("SID");
if (preg_match("/[^0-9]/", $SID)) {
respond("BADID", '', true);
}
if ($SID == '') {
respond("NOID", '', true);
}
// CONNECT TO THE DATABASE
$mysqli = new mysqli('cge', 'cgeclient', 'www', 'cge');
// CHECK CONNECTION
if (mysqli_connect_errno()) {
respond("Connect failed: %s\n", mysqli_connect_error(), '', true);
}
// CHECK USERNAME, SESSIONID AND ISOLATE
$stmt = $mysqli->prepare("SELECT u.id, u.session_id, i.isolate_path, s.folder \n FROM users u \n INNER JOIN isolates i ON i.owner = u.id \n INNER JOIN services s ON s.isolate_id = i.id \n WHERE u.usr = ?\n AND s.id = ?\n ;");
$stmt->bind_param('ss', $USERNAME, $SID);
示例4: _INPUT
<?php
$album_cat = _INPUT("sac", "");
?>
<div id="lightbox">
<div id="lightboxPhoto">
</div>
<div id="lightboxCaption">
(Click image to close)
</div>
</div>
<div class="sc_album_cat">
<?php
$current_album = album_categories_list($album_cat);
?>
</div>
<div class="sc_album_content">
<?php
album_content($current_album);
?>
</div>
示例5: respond
respond('NODATA', '');
}
} else {
// RESPOND WITH REJECTION
respond($status, '', '');
}
//CLOSING DATABASE
$mysqli->close();
} else {
// VALIDATE INPUTS
$filename = _INPUT('FILENAME');
$iid = _INPUT('IID');
$date = _INPUT('DATE');
$sid = _INPUT('SID');
$service = _INPUT('SERVICE');
$version = _INPUT('VERSION');
if ($filename == '') {
respond("NOFILENAME", '', true);
}
if ($iid == '') {
respond("NOIID", '', true);
}
if ($date == '') {
respond("NODATE", '', true);
}
if ($sid == '') {
respond("NOSID", '', true);
}
if ($service == '') {
respond("NOSERVICE", '', true);
}
示例6: elseif
//"run$rid"
} elseif ($pm_id) {
$isolate['runs'][$rid]['servicedata']['pm_id'] = $pm_id;
} elseif ($rf_id) {
$isolate['runs'][$rid]['servicedata']['rf_id'] = $rf_id;
}
return $isolate;
}
}
// MAIN
if (count($_POST) > 0) {
# or count($_GET)>0 // There is inputs
// GET INPUTS
$USERNAME = _INPUT('USERNAME');
$SESSIONID = _INPUT('SESSIONID');
$ACTION = _INPUT('ACTION');
// Checking if username is invalid
if (preg_match("/[^A-Za-z0-9\\,\\_\\-\\.\\@]/", $USERNAME) or strlen($USERNAME) < 2) {
respond('BADUSER', '');
}
// Checking if session id is invalid
if (preg_match("/[^A-Za-z0-9]/", $SESSIONID) or strlen($SESSIONID) < 40) {
respond('BADSESSIONID', '');
}
// Checking if action is invalid
if (preg_match("/[^a-z]/", $ACTION) or strlen($ACTION) != 3) {
respond('BADACTION', '');
}
// CONNECT TO THE DATABASE
$mysqli = new mysqli('cge', 'cgeclient', 'www', 'cge');
// CHECK CONNECTION
示例7: _INPUT
<?php
$blog_page = _INPUT("bp", "front");
$blog_list_offset = _INPUT("o", 0);
/*
if($blog_page === "front") {
blog_front_page();
} else {
blog_post($blog_page);
}
*/
switch ($blog_page) {
case "front":
blog_front_page();
break;
case "archive":
$archive_year = _INPUT("ayr", "");
$archive_month = _INPUT("amo", "");
if ($archive_month === "" || $archive_year === "") {
blog_archives_list();
//switch to archive front
} else {
blog_archive($archive_year, $archive_month);
}
break;
default:
blog_post($blog_page);
break;
}
示例8: _INPUT
$name = _INPUT('NAME');
$note = _INPUT('NOTE');
$mdate = _INPUT('MDATE');
$technology = _INPUT('TECHNOLOGY');
$ipublic = _INPUT('IPUBLIC');
$country = _INPUT('COUNTRY');
$region = _INPUT('REGION');
$city = _INPUT('CITY');
$zip = _INPUT('ZIP');
$lon = _INPUT('LON');
$lat = _INPUT('LAT');
$lnote = _INPUT('LOCNOTE');
$origin = _INPUT('ORIGIN');
$onote = _INPUT('ONOTE');
$pathogenicity = _INPUT('PATHOGENICITY');
$pnote = _INPUT('PNOTE');
if ($iid == '' or $iid == null) {
respond("NOIID", '', true);
}
if ($country == '' or $country == null) {
respond("NOCOUNTRY", '', true);
}
if (preg_match("/[^0-9]/", $iid)) {
respond("BADIID", array('VALUE' => $iid), true);
}
if (preg_match("/[^0-9\\.]/", $lon)) {
respond("BADLON", array('VALUE' => $lon), true);
}
if (preg_match("/[^0-9\\.]/", $lat)) {
respond("BADLAT", array('VALUE' => $lat), true);
}
示例9: count
}
}
// MAIN
if (count($_POST) > 0 and isset($_SESSION['SESSIONID']) and isset($_SESSION['USERNAME'])) {
# count($_POST)>0 or count($_GET)>0
// VALIDATE SESSION
$SESSIONID = $_SESSION['SESSIONID'];
$USERNAME = $_SESSION['USERNAME'];
if (preg_match("/[^A-Za-z0-9\\_\\-\\.\\@\\,]/", $USERNAME)) {
respond("BADUSER", '', true);
}
if (preg_match("/[^A-fa-f0-9]/", $SESSIONID)) {
respond("BADSESSION", '', true);
}
// VALIDATE INPUTS
$IID = _INPUT("IID");
if (preg_match("/[^0-9]/", $IID)) {
respond("BADID", '', true);
}
if ($IID == '') {
respond("NOID", '', true);
}
// CONNECT TO THE DATABASE
$mysqli = new mysqli('cge', 'cgeclient', 'www', 'cge');
// CHECK CONNECTION
if (mysqli_connect_errno()) {
respond("Connect failed: %s\n", mysqli_connect_error(), '', true);
}
// CHECK USERNAME, SESSIONID AND ISOLATE
$stmt = $mysqli->prepare("SELECT u.id, u.session_id, i.public, i.isolate_path\n FROM isolates i\n INNER JOIN users u ON u.id = i.owner\n WHERE u.usr = ?\n AND i.id = ?\n ;");
$stmt->bind_param('ss', $USERNAME, $IID);
示例10: respond
respond("NORESULTS", $msg, true);
}
}
//////////////////////// MAIN ////////////////////////
// CHECK FOR CORRECT INPUTS
if (isset($_SESSION['SESSIONID']) and isset($_SESSION['USERNAME'])) {
// VALIDATE SESSION
$SESSIONID = $_SESSION['SESSIONID'];
$USERNAME = $_SESSION['USERNAME'];
if (preg_match("/[^A-Za-z0-9\\_\\-\\.\\@\\,]/", $USERNAME)) {
respond("BADUSER", '', true, true, true);
}
if (preg_match("/[^A-fa-f0-9]/", $SESSIONID)) {
respond("BADSESSION", '', true, true, true);
}
if (_INPUT('view') == 'resistance') {
$view = 'resistance';
} else {
$view = '';
}
// CONNECT TO THE DATABASE
$mysqli = new mysqli('cge', 'cgeclient', 'www', 'cge');
// CHECK CONNECTION
if (mysqli_connect_errno()) {
respond("MYSQLERROR", array('MESSAGE' => "Connect failed: %s\n", mysqli_connect_error()), true, true, true);
}
// VALIDATE USER AND EXTRACT UID => $status = ACCEPTED or NOUSER or INVALIDSESSION
list($status, $uid) = ValidateUser($mysqli, $USERNAME, $SESSIONID);
// CLOSING CONNECTION
$mysqli->close();
// Extract Result data
示例11: respond
}
}
// MAIN
if (count($_POST) > 0 and isset($_SESSION['SESSIONID']) and isset($_SESSION['USERNAME'])) {
#+count($_GET)
// VALIDATE SESSION
$USERNAME = $_SESSION['USERNAME'];
$SESSIONID = $_SESSION['SESSIONID'];
if (preg_match("/[^A-Za-z0-9\\_\\-\\.\\@\\,]/", $USERNAME)) {
respond("BADUSER", '', '', true);
}
if (preg_match("/[^A-fa-f0-9]/", $SESSIONID)) {
respond("BADSESSION", '', '', true);
}
// VALIDATE INPUTS
$IID = _INPUT('ISOLATEID');
if (preg_match("/[^0-9]/", $IID)) {
respond("BADISOLATE", '', '', true);
}
// CONNECT TO THE DATABASE
$mysqli = new mysqli('cge', 'cgeclient', 'www', 'cge');
// CHECK CONNECTION
if (mysqli_connect_errno()) {
respond("Connect failed: %s\n", mysqli_connect_error(), '', '', true);
}
// CHECK USERNAME AND SESSIONID
$stmt = $mysqli->prepare("SELECT id, session_id FROM users WHERE usr = ?");
$stmt->bind_param('s', $USERNAME);
// EXECUTE AND GET RESULTS
$stmt->execute();
$stmt->bind_result($uid, $sid);
示例12: ini_set
ini_set('display_errors', 1);
error_reporting(E_ALL);
require_once "./system/phpfastcache.php";
include './system/parsedown.php';
include './system/ParsedownExtra.php';
include './system/settings.php';
$fastCache = phpFastCache();
if ($clear_all_caches) {
$fastCache->clean();
}
$cache_time = 3600 * 24 * $cache_time_days;
// Cache time is in seconds.
$enabled_plugins = array();
$enabled_stylesheets = array();
$enabled_scripts = array();
$current_page = _INPUT('p', 'index');
$registered_pages = array('Home' => sculpt_page_url('index'));
$registered_processors = array('system' => '');
include './extras/plugins/enabled.php';
function sculpt_system($arg)
{
if (isset($arg)) {
switch ($arg) {
case "path":
return "./system/";
break;
case "content_path":
return "./content/";
break;
case "default_look":
return "appearance/armature/main.php";
示例13: respond
include_once '/srv/www/php-lib/cge_std_tools.php';
// Including CGE_std clases and functions
//////////////////////// MAIN /////////////////////////
if (count($_POST) + count($_GET) > 0 and isset($_SESSION['SESSIONID']) and isset($_SESSION['USERNAME'])) {
// VALIDATE SESSION
$SESSIONID = $_SESSION['SESSIONID'];
$USERNAME = $_SESSION['USERNAME'];
if (preg_match("/[^A-Za-z0-9\\_\\-\\.\\@\\,]/", $USERNAME)) {
respond("BADUSER", '', true, true, true);
}
if (preg_match("/[^A-fa-f0-9]/", $SESSIONID)) {
respond("BADSESSION", '', true, true, true);
}
// VALIDATE INPUTS
$iid = _INPUT('IID');
$sid = _INPUT('SID');
if (preg_match("/[^0-9]/", $iid)) {
respond("BADIID", array('VALUE' => $iid), true, true, true);
}
if (preg_match("/[^0-9]/", $sid)) {
respond("BADSID", array('VALUE' => $sid), true, true, true);
}
// Set global variables
$htdocs = "/srv/www/htdocs/services/";
$wwwroot = "https://cge.cbs.dtu.dk/services/";
// CONNECT TO THE DATABASE
$mysqli = new mysqli('cge', 'cgeclient', 'www', 'cge');
// CHECK CONNECTION
if (mysqli_connect_errno()) {
respond("MYSQLERROR", array('MESSAGE' => "Connect failed: %s\n", mysqli_connect_error()), true, true, true);
}
示例14: respond
} else {
return NULL;
}
}
function respond($status, $SESSIONID, $USERNAME, $EXIT = false)
{
echo "<?xml version='1.0' encoding='UTF-8'?><SESSION><STATUS>{$status}</STATUS><SESSIONID>{$SESSIONID}</SESSIONID><USERNAME>{$USERNAME}</USERNAME></SESSION>";
if ($EXIT == true) {
exit;
}
}
// MAIN
if (count($_POST) > 0) {
# or count($_GET)>0
// VALIDATE INPUT
$EMAIL = _INPUT("EMAIL");
if (!is_email($EMAIL)) {
respond("BADEMAIL", '', '', true);
}
// CONNECT TO THE DATABASE
$mysqli = new mysqli('cge', 'cgeclient', 'www', 'cge');
// CHECK CONNECTION
if (mysqli_connect_errno()) {
respond("Connect failed: %s\n", mysqli_connect_error(), '', '', true);
}
// CHECK USERNAME AND EMAIL AVAILABILITY
$stmt = $mysqli->prepare("SELECT status, usr, pwd FROM users WHERE email = ?");
$stmt->bind_param('s', $EMAIL);
// EXECUTE AND GET RESULTS
$stmt->execute();
$stmt->bind_result($stat, $usr, $pwd);
示例15: count
{
echo "<?xml version='1.0' encoding='UTF-8'?><SESSION><STATUS>{$status}</STATUS><SESSIONID>{$SESSIONID}</SESSIONID><USERNAME>{$USERNAME}</USERNAME></SESSION>";
if ($EXIT == true) {
exit;
}
}
// MAIN
if (count($_POST) > 0) {
# or count($_GET)>0
$securimage = new Securimage();
$key = ")gIs56bi%";
// VALIDATE INPUTS
$USERNAME = _INPUT("USERNAME");
$PASSWORD = sha1($key . $USERNAME . _INPUT("PASSWORD") . $key);
$EMAIL = _INPUT("EMAIL");
$CAPTCHA = preg_replace("/[^A-Za-z0-9]/", '', _INPUT("CAPTCHA"));
if (preg_match("/[^A-Za-z0-9\\_\\-\\.\\@\\,]/", $USERNAME)) {
respond("BADUSER", '', '', true);
}
if (!is_email($EMAIL)) {
respond("BADEMAIL", $EMAIL, '', true);
}
//if ($securimage->check($CAPTCHA) == false) { respond("BADIMAGE", '', '', true); }
// CONNECT TO THE DATABASE
$mysqli = new mysqli('cge', 'cgeclient', 'www', 'cge');
// CHECK CONNECTION
if (mysqli_connect_errno()) {
respond("Connect failed: %s\n", mysqli_connect_error(), '', '', true);
}
// CHECK USERNAME AND EMAIL AVAILABILITY
$stmt = $mysqli->prepare("SELECT usr FROM users WHERE usr = ? OR email = ?");