当前位置: 首页>>代码示例>>PHP>>正文


PHP inp函数代码示例

本文整理汇总了PHP中inp函数的典型用法代码示例。如果您正苦于以下问题:PHP inp函数的具体用法?PHP inp怎么用?PHP inp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了inp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isinp

function isinp($info = array("prompt" => "this is a prompt", "q" => array(array("bounce", "jump", "hop"), array("walk", "stroll", "ambulate")), "outcome" => array(0 => "fail", 1 => "success A", 2 => "success B")))
{
    $option = 0;
    $failure = $info["outcome"][$option];
    $output = $info["outcome"][$option];
    while ($output == $failure) {
        sleep(2);
        echo $info["prompt"] . "\n";
        $inpstring = inp();
        //retrieve user input and put it in variable
        foreach ($info["q"] as $key => $action) {
            foreach ($action as $word) {
                if (stristr($inpstring, $word)) {
                    sleep(2);
                    //$option = $action + 1;
                    $output = $info["outcome"][$key + 1];
                    // . "\n";
                    break 1;
                }
            }
        }
        if ($output == $failure) {
            sleep(1);
            echo $output . "\n";
        }
    }
    sleep(1);
    echo $output . "\n";
    //print_r($info["q"]);
}
开发者ID:ReqApi,项目名称:phptea,代码行数:30,代码来源:phpnoo.php

示例2: icocss_menu

function icocss_menu($p, $o, $rid)
{
    $ret .= inp('inp', $p) . ' ';
    $ret .= lj('', $rid . '_plug__2_icocss_icocss*j___inp', picto('reload')) . ' ';
    $ret .= lj('', $rid . '_plug__2_icocss_icocss*build', picto('save')) . ' ';
    return $ret;
}
开发者ID:philum,项目名称:cms,代码行数:7,代码来源:icocss.php

示例3: index

 public function index()
 {
     session_start();
     $id0 = $_SESSION['customerid'];
     $un0 = $_SESSION['username'];
     $pw0 = $_SESSION['password'];
     $t0 = $_SESSION['accesstime'];
     $data['id0'] = $id0;
     $data['un0'] = $un0;
     $data['pw0'] = $pw0;
     $data['t0'] = $t0;
     $nowtime = time();
     // echo $un0;
     // echo $t0;
     if ($nowtime - $t0 > 1440) {
         session_destroy();
         //   echo $nowtime." | ";
         //   $tmp=$nowtime-$t0;
         //   echo $tmp;
         header('Location:' . site_url('Login'));
         exit;
     }
     $this->load->model("login_model");
     $res0 = $this->login_model->validateprofile($un0);
     $tmp = 0;
     foreach ($res0 as $row0) {
         $tmp = $tmp + 1;
     }
     //  if(!($row0 = mysql_fetch_assoc($res0)))
     if ($tmp == 0) {
         //echo 111;
         header('Location:' . site_url('Login'));
         exit;
     }
     function inp($data)
     {
         $data = trim($data);
         $data = stripslashes($data);
         $data = htmlspecialchars($data);
         return $data;
     }
     //get search option
     $this->load->model("search_model");
     $search_res = $this->search_model->getcategory();
     $data['search_res'] = $search_res;
     //get the input
     $productcategoryid = inp($_POST['productcategoryid']);
     $productid = inp($_POST['productid']);
     $this->load->model("search_model");
     $product_res = $this->search_model->getproduct($productcategoryid, $productid);
     $data['product_res'] = $product_res;
     $data['productid_res'] = $productid;
     //the search option
     //save the search option
     //  $searchopt=
     //echo $product_res;
     //output
     $this->load->view('search.php', $data);
 }
开发者ID:BarFox,项目名称:gitDir,代码行数:59,代码来源:Search.php

示例4: model_menu

function model_menu($p, $o, $rid)
{
    $ret = select_j('inp', 'pfunc', '', 'model/model_r', '', '2');
    //$ret.=togbub('plug','model_model*r',btn('popbt','select...'));
    $ret .= inp('inp', $p) . ' ';
    $ret .= lj('', $rid . '_plug__2_model_model*j___inp', picto('reload')) . ' ';
    return $ret;
}
开发者ID:philum,项目名称:cms,代码行数:8,代码来源:_model.php

示例5: menu

 static function menu($p, $o, $rid)
 {
     $ret = inp('inp', $p) . ' ';
     $ret .= lj('', $rid . '_app__2_model_build___inp', picto('reload')) . ' ';
     //$cols='ib,val,to';//create table, name cols
     //$ret.=lj('','popup_plupin___msqedit_model*1_'.$cols,picto('edit'));
     return $ret;
 }
开发者ID:philum,项目名称:cms,代码行数:8,代码来源:_app.php

示例6: del_com

function del_com($p, $o)
{
    $rid = 'plg' . randid();
    $id = 'del' . $o;
    $ret .= inp('inp' . $o, $p ? $p : $o, atz(44)) . ' ';
    $ret .= lj('popsav', $rid . '_plug___del_delj_' . $o . '__inp' . $o, 'delete') . ' ';
    $ret .= btd($rid, '') . br();
    return $ret;
}
开发者ID:philum,项目名称:cms,代码行数:9,代码来源:del.php

示例7: index

 public function index()
 {
     function inp($data)
     {
         $data = trim($data);
         $data = stripslashes($data);
         $data = htmlspecialchars($data);
         return $data;
     }
     $this->load->model("search_model");
     $search_res = $this->search_model->getcategory();
     $data['search_res'] = $search_res;
     // echo "here ".$search_res;
     if ($_POST['succeed'] == 'succeed') {
         //php validate ([A-Z][a-z]*( |$))+
         if (preg_match("/[^a-zA-Z0-9\\s]/", inp($_POST['customername']), $par1) || preg_match("/[^a-zA-Z0-9\\s]/", inp($_POST['customeraddress']), $par2) || preg_match("/[^0-9]/", inp($_POST['creditcard']), $par3) || !preg_match("/^\\d\\d\\d\$/", inp($_POST['securitycode']), $par4) || !preg_match("/^(([1-9])|(0[1-9])|(1[0-2]))\\/\\d\\d\$/", inp($_POST['expirationdate']), $par5) || preg_match("/[^a-zA-Z0-9]/", inp($_POST['username']), $par6) || preg_match("/[^a-zA-Z0-9]/", inp($_POST['password0']), $par7)) {
             $errormsg = 'Sign up failed, please check all the input requirements';
             $data['errormsg'] = $errormsg;
             $this->load->view('signup.php', $data);
             //   $this->load->view('postlogin.html');
             return;
         }
         $this->load->model("signup_model");
         $res = $this->signup_model->insertcustomer(inp($_POST['customername']), inp($_POST['customeraddress']), inp($_POST['creditcard']), inp($_POST['securitycode']), inp($_POST['expirationdate']), inp($_POST['username']), inp($_POST['password0']));
         //
         //   echo gothere;
         $this->load->model("signup_model");
         $res7 = $this->signup_model->getlastid();
         $row7 = mysql_fetch_assoc($res7);
         $lastid = $row7['LAST_INSERT_ID()'];
         //  echo $lastid;
         //   echo $lastid;
         //build session
         $_SESSION['username'] = inp($_POST['username']);
         $_SESSION['password'] = inp($_POST['password0']);
         //when to destroy? need a log out? how to set the timeout?
         $_SESSION['customerid'] = $lastid;
         $_SESSION['accesstime'] = time();
         //echo $_SESSION['username'];
         //echo $_SESSION['password'];
         //echo $_SESSION['customerid'];
         //echo $_SESSION['accesstime'];
         //add some php validate
         //   header("Location: search.php");
         //jump to that page
         //  $this->load->view('search.php',$data);
         header('Location:' . site_url('Search'));
     } else {
         //    $row2 = mysql_fetch_assoc($search_res);
         //   echo "got ".$row2['productcategoryid'];
         $this->load->view('signup.php', $data);
     }
     //	$this->load->view('welcome_message');
 }
开发者ID:BarFox,项目名称:gitDir,代码行数:54,代码来源:Signup.php

示例8: menu

 static function menu($p, $o, $rid)
 {
     $ret = inp('inp', $p ? $p : 1) . ' ';
     $ret .= lj('', $rid . '_app___slides_j__' . $rid . '_inp', picto('reload')) . ' ';
     if (auth(6)) {
         $ret .= lj('', 'popup_plupin___msqedit_slides*' . $p . '_val', picto('edit')) . ' ';
         $j = 'popup_msqledit___users_' . ajx(ses('nodslid')) . '_';
         $ret .= lj('', $j . $p . '_1', picto('editxt')) . ' ';
         $ret .= lj('', 'popup_plup___msqedit_msqdt*add_slides*' . $p . '_val', picto('add')) . ' ';
     }
     return divc('', $ret);
 }
开发者ID:philum,项目名称:cms,代码行数:12,代码来源:slides.php

示例9: plug_umglyphes

function plug_umglyphes($p, $o)
{
    if ($o == '1') {
        return ug_build($p);
    }
    $ret .= lj('', 'umglph___4', picto('del')) . ' ';
    $ret .= inp('umglph', $p, atz('44')) . ' ';
    $ret .= lj('popsav', 'umgl_plug___umglyphes_ug*build_' . ajx($p) . '__umglph', 'ok') . ' ';
    $ret .= divd('umgl', ug_build($p)) . br();
    $ret .= msqlink('', 'ummo_umvoc_1', '') . ' ';
    $ret .= lkt('', '/plug/umvoc', picto('link'));
    return $ret;
}
开发者ID:philum,项目名称:cms,代码行数:13,代码来源:umglyphes.php

示例10: index

 public function index()
 {
     session_start();
     $id0 = $_SESSION['customerid'];
     $un0 = $_SESSION['username'];
     $pw0 = $_SESSION['password'];
     $t0 = $_SESSION['accesstime'];
     $data['id'] = $id0;
     $data['un'] = $un0;
     $data['pw'] = $pw0;
     $data['t0'] = $t0;
     $nowtime = time();
     if ($nowtime - $t0 > 1440) {
         session_destroy();
         header('Location:' . site_url('Login'));
         exit;
     }
     $this->load->model("login_model");
     $res0 = $this->login_model->validateprofile($un0);
     if (!($row0 = mysql_fetch_assoc($res0))) {
         // echo lll;
         header('Location:' . site_url('Login'));
         exit;
     }
     function inp($data)
     {
         $data = trim($data);
         $data = stripslashes($data);
         $data = htmlspecialchars($data);
         return $data;
     }
     $errormsg = "";
     if ($_POST['succeed'] == 'succeed') {
         $this->load->model("accountinfo_model");
         $res0 = $this->accountinfo_model->updatecustomer(inp($_POST['username']), inp($_POST['password0']), inp($_POST['customername']), inp($_POST['customeraddress']), inp($_POST['creditcard']), inp($_POST['securitycode']), inp($_POST['expirationdate']), $id0);
         $errormsg = "Your infomation has been successfully saved.";
     }
     $data['errormsg'] = $errormsg;
     $this->load->model("accountinfo_model");
     $res3 = $this->accountinfo_model->showcustomer($id0);
     $data['res3'] = $res3;
     //get search option
     $this->load->model("search_model");
     $search_res = $this->search_model->getcategory();
     $data['search_res'] = $search_res;
     //output
     $this->load->view('accountinfo.php', $data);
 }
开发者ID:BarFox,项目名称:gitDir,代码行数:48,代码来源:Accountinfo.php

示例11: f

function f($idcolumn, $arrayOFchisla, $n, $loe, $key)
{
    //надо переделать
    $poscenter = Math . round($n / 2) + 1;
    $a = inp($idcolumn, $arrayOFchisla, $n);
    $inparr = $a[1];
    $b = xor2($key[3], $inparr[0], $loe);
    $b = for2(1, $poscenter, $b, $inparr, $loe);
    //
    $b = xor2($key[2], $b, $loe);
    $b = for2($poscenter + 1, $a[0] - 3, $b, $inparr, $loe);
    //
    $b = xor2($key[1], $b, $loe);
    $b = xor2($inparr[$a[0] - 2], $b, $loe);
    $b = xor2($inparr[$a[0] - 1], $b, $loe);
    return $b;
}
开发者ID:lexasub,项目名称:shifrWithPHP,代码行数:17,代码来源:shifrovanie.php

示例12: index

 public function index()
 {
     function inp($data)
     {
         $data = trim($data);
         $data = stripslashes($data);
         $data = htmlspecialchars($data);
         return $data;
     }
     $this->load->model("search_model");
     $search_res = $this->search_model->getcategory();
     $data['search_res'] = $search_res;
     // echo "here ".$search_res;
     if ($_POST['succeed'] == 'succeed') {
         $this->load->model("signup_model");
         $res = $this->signup_model->insertcustomer(inp($_POST['customername']), inp($_POST['customeraddress']), inp($_POST['creditcard']), inp($_POST['securitycode']), inp($_POST['expirationdate']), inp($_POST['username']), inp($_POST['password0']));
         //
         $this->load->model("signup_model");
         $res7 = $this->signup_model->getlastid();
         $row7 = mysql_fetch_assoc($res7);
         $lastid = $row7['LAST_INSERT_ID()'];
         //   echo $lastid;
         //build session
         $_SESSION['username'] = inp($_POST['username']);
         $_SESSION['password'] = inp($_POST['password0']);
         //when to destroy? need a log out? how to set the timeout?
         $_SESSION['customerid'] = $lastid;
         $_SESSION['accesstime'] = time();
         //echo $_SESSION['username'];
         //echo $_SESSION['password'];
         //echo $_SESSION['customerid'];
         //echo $_SESSION['accesstime'];
         //add some php validate
         //   header("Location: search.php");
         //jump to that page
         //  $this->load->view('search.php',$data);
         header('Location:' . site_url('Search'));
     } else {
         //    $row2 = mysql_fetch_assoc($search_res);
         //   echo "got ".$row2['productcategoryid'];
         $this->load->view('signup.php', $data);
     }
     //	$this->load->view('welcome_message');
 }
开发者ID:BarFox,项目名称:gitDir,代码行数:44,代码来源:Signup.php

示例13: stripslashes

    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
}
//usertype
if ($ut != 'manager') {
    //require 'login.php';
    //  die;//?
    header("Location: login.php");
    //  echo $ut." ".$un;
    exit;
}
// echo $ut;
$lowlimit = inp($_POST['lowlimit']);
$highlimit = inp($_POST['highlimit']);
$usertype = inp($_POST['usertype']);
echo "asd " . $usertype . " dasd";
//delete is handled in the same page
if (strlen($lowlimit) == 0) {
    $lowlimit = 0;
}
if (strlen($highlimit) == 0) {
    $highlimit = 99999999;
    //this is not a good way
}
if ($usertype == 'undefined') {
    $usertype = "%";
}
$sql = "select * from users, employees where  users.userindex = employees.userindex and employees.salary < " . $highlimit . " and employees.salary > " . $lowlimit . " and users.usertype like '" . $usertype . "'";
echo "seccessful: " . $sql;
?>
开发者ID:BarFox,项目名称:gitDir,代码行数:31,代码来源:showElist.php

示例14: htmlspecialchars

    $data = htmlspecialchars($data);
    return $data;
}
//usertype
if ($ut != 'manager') {
    //require 'login.php';
    //  die;//?
    header("Location: login.php");
    //  echo $ut." ".$un;
    exit;
}
// echo $ut;
$lowlimit = inp($_POST['lowlimit']);
$highlimit = inp($_POST['highlimit']);
$productid = inp($_POST['productname']);
$category = inp($_POST['category']);
echo "asd " . $category . " dasd";
//delete is handled in the same page
if (strlen($lowlimit) == 0) {
    $lowlimit = 0;
}
if ($productid == 'undefined') {
    $productid = "%";
}
if (strlen($highlimit) == 0) {
    $highlimit = 99999999;
    //this is not a good way
}
if ($category == 'undefined') {
    $category = "%";
}
开发者ID:BarFox,项目名称:gitDir,代码行数:31,代码来源:showPlist.php

示例15: trim

    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
}
if ($_POST['succeed'] == 'succeed') {
    $sql = "insert into customer (customername,customeraddress,creditcard,securitycode,expirationdate,username,password) values ('" . inp($_POST['customername']) . "','" . inp($_POST['customeraddress']) . "','" . inp($_POST['creditcard']) . "','" . inp($_POST['securitycode']) . "','" . inp($_POST['expirationdate']) . "','" . inp($_POST['username']) . "',password('" . inp($_POST['password0']) . "'))";
    $res = mysql_query($sql, $con);
    //
    $sql7 = "SELECT LAST_INSERT_ID()";
    $res7 = mysql_query($sql7, $con);
    $row7 = mysql_fetch_assoc($res7);
    $lastid = $row7['LAST_INSERT_ID()'];
    //build session
    $_SESSION['username'] = inp($_POST['username']);
    $_SESSION['password'] = inp($_POST['password0']);
    //when to destroy? need a log out? how to set the timeout?
    $_SESSION['customerid'] = $lastid;
    $_SESSION['accesstime'] = time();
    //add some php validate
    header("Location: search.php");
    exit;
}
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>CS571 Assignment 3</title>
        <link rel="stylesheet" type="text/css" href="style.css" />
        <script type="text/javascript" src="jsfile.js"></script>
    </head>
开发者ID:BarFox,项目名称:gitDir,代码行数:31,代码来源:signup.php


注:本文中的inp函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。