當前位置: 首頁>>代碼示例>>PHP>>正文


PHP _INPUT函數代碼示例

本文整理匯總了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);
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:cancel_reset_user.php

示例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
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:delete_run.php

示例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);
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:delete_run.php

示例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>
開發者ID:antijingoist,項目名稱:SculptCMS,代碼行數:21,代碼來源:album_page.php

示例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);
     }
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:download_files.php

示例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
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:isolate_db_manager.php

示例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;
}
開發者ID:antijingoist,項目名稱:SculptCMS,代碼行數:29,代碼來源:blog_start.php

示例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);
 }
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:update_isolate.php

示例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);
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:delete_isolate.php

示例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
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:get_all_data_as_tab.php

示例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);
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:get_isolate.php

示例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";
開發者ID:antijingoist,項目名稱:SculptCMS,代碼行數:31,代碼來源:engine.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);
    }
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:show_result.php

示例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);
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:reset_user.php

示例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 = ?");
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:31,代碼來源:create_user.php


注:本文中的_INPUT函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。