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


PHP checkData函数代码示例

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


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

示例1: img_thumb

 /**
 +--------------------------------------------------
 * 生成图片缩略图
 +--------------------------------------------------
 */
 public function img_thumb()
 {
     $gData = checkData($_GET);
     $w = $gData['w'] + 0;
     $h = $gData['h'] + 0;
     $allow_width = array(300, 720);
     $allow_height = array(168, 405);
     if (!in_array($w, $allow_width)) {
         die(json_encode(array('code' => -201, "msg" => "参数错误")));
     }
     if (!in_array($h, $allow_height)) {
         die(json_encode(array('code' => -202, "msg" => "参数错误")));
     }
     $img_path = substr(HTML_PATH, 0, -1);
     ///images/videos/14999572630/screenshot/1d1c67cd5c1926a6e379fb78c711b87b_360X640.png
     $img_file = MD5(xxx);
     if (!file_exists($img_file)) {
         //生成图片
     } else {
         //读取图片
     }
     //        $this->img_operate->open($img_path.$addData['pic_url']);
     //        if ($this->img_operate->width() == '135' && $this->img_operate->height() == '135') {
     //            $this->img_operate->save(HTML_PATH . '/images/videos/' . $_v['video_id'] . '/yingyongbao/', $imageName);
     //        } else {
     //            $this->img_operate->thumb(300, 300, 3)->save(HTML_PATH . '/images/videos/' . $_v['video_id'] . '/yingyongbao/', $imageName);
     //            $this->img_operate->open(HTML_PATH . '/images/videos/' . $_v['video_id'] . '/yingyongbao/' . $imageName);
     //            $this->img_operate->thumb(135, 135, 1)->save(HTML_PATH . '/images/videos/' . $_v['video_id'] . '/yingyongbao/', $imageName);
     //        }
     //
     //        $this->img_operate->thumb(300, 300, 3)->save(HTML_PATH . '/images/videos/' . $_v['video_id'] . '/yingyongbao/', $imageName);
     //        $this->img_operate->open(HTML_PATH . '/images/videos/' . $_v['video_id'] . '/yingyongbao/' . $imageName);
 }
开发者ID:bibyzhang,项目名称:produce_cms,代码行数:38,代码来源:img.php

示例2: develop_public

    /** markdown格式接口 */
    public function develop_public()
    {
        $gData = checkData($_GET);
        $int_opt = $gData['int_opt'];
        if (!$int_opt) {
            ajaxReturn('非法操作[缺少必须参数]', 300);
        }
        //样式
        echo '<style>
            .markdown-here-wrapper h1{ font-size: 20px; font-weight:bold; margin-top: 10px;}
            .markdown-here-wrapper h2{ font-size: 18px; font-weight:bold; margin-top: 10px;}
            .markdown-here-wrapper h3{ font-size: 16px; font-weight:bold; margin-top: 10px;}
            .markdown-here-wrapper table{ border-collapse: collapse; border: 1px solid yellowgreen;}
            .markdown-here-wrapper th { vertical-align: baseline; border: 1px solid yellowgreen; font-weight:bold; font-size: 18px;}
            .markdown-here-wrapper td { vertical-align: middle; border: 1px solid yellowgreen; font-size: 18px;}
            .markdown-here-wrapper tr { border: 1px solid yellowgreen;}

            .markdown-here-wrapper p a{font-size: 16px;}
            </style>';
        $output = $text = file_get_contents(MODULE_PATH . 'develop_info/' . $int_opt . '.md');
        $parser = new MarkdownExtra();
        $my_html = $parser->transform($output);
        $this->s->assign('my_html', $my_html);
        $this->s->display('interface_admin/interface_list.html');
    }
开发者ID:bibyzhang,项目名称:produce_cms,代码行数:26,代码来源:develop_doc.php

示例3: login

 /** 用户登录 */
 public function login()
 {
     $pData = checkData($_POST);
     $AdminUserTable = $this->OperateTable['AdminUserTable'];
     $AdminRoleTable = $this->OperateTable['AdminRoleTable'];
     $user_name = $pData['user_name'];
     $user_pass = $pData['user_pass'];
     $verify_code = $pData['verify_code'];
     //已经登录,跳转到管理首页
     $user_id = !empty($_SESSION['user_id']) ? $_SESSION['user_id'] : 0;
     if ($user_id) {
         toUrl('INDEX');
     }
     if ($user_name && !$user_pass) {
         $this->s->assign('error', '请同时输入账号、密码和动态密码');
     }
     if ($pData) {
         if (MD5($verify_code) != $_SESSION['verify_code']) {
             $this->s->assign('error', '验证码错误!');
             $this->s->display('admin/login.html');
             exit;
         }
     }
     if ($pData && $user_name && $user_pass) {
         /*
         //获取密保key
         $sql = "SELECT mb_key FROM $AdminUserTable WHERE user_name='{$user_name}' AND status=1";
         $userData = $this->db->get($sql);
         $mb_key = $userData['mb_key'];
         
         $pass = MD5(MD5($mb_key . $user_pass));
         */
         $pass = MD5($user_pass);
         $sql = "SELECT user_id,user_name,role_id,auth FROM {$AdminUserTable} WHERE user_name='{$user_name}' AND user_pass='{$pass}' AND status=1";
         $data = $this->db->get($sql);
         if ($data) {
             $ip = $_SERVER['REMOTE_ADDR'];
             $ltime = time();
             $login_sql = "UPDATE {$AdminUserTable} SET lastlogin_ip='{$ip}',lastlogin_time={$ltime},login_times=login_times+1 WHERE user_name='" . $data['user_name'] . "'";
             $this->db->query($login_sql);
             $_SESSION['user_id'] = array('user_id' => $data['user_id'], 'user_name' => $data['user_name']);
             //权限记录[菜单操作权限]
             if ($data['user_id'] == 1) {
                 //超级管理员,所有权限
                 $_SESSION['user_id']['actionid'] = 'all';
             } else {
                 //权限组权限+用户单独权限
                 $auth_sql = "SELECT auth FROM {$AdminRoleTable} WHERE role_id=" . $data['role_id'];
                 $auth_data = $this->db->get($auth_sql);
                 $_SESSION['user_id']['actionid'] = array_merge((array) unserialize($data['auth']), (array) unserialize($auth_data['auth']));
             }
             toUrl('INDEX');
             //跳转至首页
         } else {
             $this->s->assign('error', "账号或密码错误");
         }
     }
     $this->s->display('admin/login.html');
 }
开发者ID:bibyzhang,项目名称:produce_cms,代码行数:60,代码来源:admin_user.php

示例4: checkEmail

function checkEmail($email)
{
    global $errors;
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        $errors['email'] = "Invalid email format";
    }
    return checkData($email);
}
开发者ID:pixelfish22,项目名称:midterm_review,代码行数:8,代码来源:validation.php

示例5: left

 /** 左侧菜单栏[横向导航条] */
 public function left()
 {
     $getData = checkData($_GET);
     //管理菜单
     $mid = !empty($getData['mid']) ? $getData['mid'] : 2;
     //默认管理游戏盒子
     $menuData = $this->leftMenu($mid);
     $this->s->assign('menuData', $menuData);
     $this->s->display('system/leftMenu.html');
 }
开发者ID:bibyzhang,项目名称:produce_cms,代码行数:11,代码来源:admin_manage.php

示例6: checkData

 function checkData($data)
 {
     if (is_array($data)) {
         foreach ($data as $key => $v) {
             $data[$key] = checkData($v);
         }
     } else {
         $data = getStr($data);
     }
     return $data;
 }
开发者ID:ohjack,项目名称:newErp,代码行数:11,代码来源:mysql.php

示例7: deleteBid

 /**
  *更新bid
  */
 public function deleteBid()
 {
     $pData = checkData($_REQUEST);
     $id = $pData['id'];
     if (!$id) {
         ajaxReturn('不能为空', 300);
     }
     $delete_sql = "DELETE FROM  waplog.`wap_bid_list`  where id={$id}";
     if ($this->db->query($delete_sql)) {
         ajaxReturn('删除成功', 200);
     } else {
         ajaxReturn('删除失败', 300);
     }
     /*
             $id = $gData['id'];
             $sql = "select * from  waplog.`wap_bid_list` WHERE id={$id}";
             $data = $this->db->get($sql);
             $this->s->assign('result', $data);*/
 }
开发者ID:13240361944,项目名称:analyze,代码行数:22,代码来源:baseInfoAction.class.php

示例8: alertInfo

if (empty($userID2)) {
    alertInfo('短信未配置,请配置', "site_sms.php", 0);
}
$tags = sqlReplace(trim($_POST['receiver']));
//收件人
$tags = str_replace(';', ';', $tags);
$tags = str_replace('#', '', $tags);
$tags = str_replace('$', '', $tags);
//$total=sqlReplace(trim($_GET['total']));//此次发送的数量
$emailstr = sqlReplace(trim($_POST['receiver']));
//收件人
$emailstr = str_replace(';', ';', $emailstr);
$content = sqlReplace(trim($_POST['fbContent']));
//短信内容
checkData($emailstr, '收件人', 1);
checkData($content, '短信内容', 1);
//对收件人$emailstr进行处理
$alltel = '';
$tgs = '';
if ($emailstr) {
    $emailarr = explode(';', $emailstr);
    $i = 0;
    $j = 0;
    $total = 0;
    foreach ($emailarr as $t) {
        if ($t) {
            $email = '';
            $tg = '';
            //if(preg_match('/#(.*?)#/',$t,$info)){
            $substr_t = substr($t, 0, 1);
            if ($substr_t == '#') {
开发者ID:piapro,项目名称:AIRestaurant,代码行数:31,代码来源:sendsms_do.php

示例9: sqlReplace

<?php

/**
 *  userorderscore2.php
 */
require_once "usercheck2.php";
$POSITION_HEADER = "用户中心";
$id = sqlReplace(trim($_GET['id']));
checkData($id, 'id', 1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css"/>
<link rel="icon" href="<?php 
echo $imgstr2;
?>
" type="image/x-icon" />
<link rel="shortcut icon" href="<?php 
echo $imgstr2;
?>
" type="image/x-icon" />
<script src="js/jquery-1.3.1.js" type="text/javascript"></script>
<script src="js/addbg.js" type="text/javascript"></script>
<script src="js/tab.js" type="text/javascript"></script>
<title> 用户中心 - <?php 
echo $SHOP_NAME;
?>
 - <?php 
echo $powered;
开发者ID:piapro,项目名称:AIRestaurant,代码行数:31,代码来源:userorderscore2.php

示例10: sqlReplace

<?php

/**
 *  shopreg_do.php 
 */
require_once "../include/dbconn.php";
$act = sqlReplace(trim($_GET['act']));
switch ($act) {
    case "login":
        $account = sqlReplace(trim($_POST['account']));
        $pwd = sqlReplace(trim($_POST['pw']));
        checkData($account, '用户名', 1);
        checkData($pwd, '密码', 1);
        $code = sqlReplace(trim($_POST["imgcode"]));
        //验证码
        if (empty($code)) {
            alertInfo('验证码不能为空', "", 1);
        }
        if ($code != $_SESSION['imgcode']) {
            alertInfo('验证码不正确,请检查!', "", 1);
        }
        $sql = "select * from qiyu_shop where shop_account='" . $account . "'";
        $rs = mysql_query($sql);
        $rows = mysql_fetch_assoc($rs);
        if ($rows) {
            $salt = $rows['shop_salt'];
            $pw = md5(md5($pwd) . $salt);
            $sqlStr = "select * from qiyu_shop where shop_account='" . $account . "' and shop_password='" . $pw . "'";
            $rs_r = mysql_query($sqlStr);
            $row = mysql_fetch_assoc($rs_r);
            if ($row) {
开发者ID:piapro,项目名称:AIRestaurant,代码行数:31,代码来源:shoplogin_do.php

示例11: sqlReplace

$pw = sqlReplace($_POST['pw']);
$repw = sqlReplace($_POST['repw']);
$vCode = sqlReplace($_POST['vcode']);
//$code = sqlReplace($_POST['a']);
$agree = sqlReplace($_POST['agree']);
$p = empty($_GET['p']) ? '' : sqlReplace(trim($_GET['p']));
//从订单页来的标示
$shopID = empty($_GET['shopID']) ? '0' : sqlReplace(trim($_GET['shopID']));
$shopSpot = empty($_GET['shopSpot']) ? '0' : sqlReplace(trim($_GET['shopSpot']));
$shopCircle = empty($_GET['shopCircle']) ? '0' : sqlReplace(trim($_GET['shopCircle']));
$savesession = $phone . ',' . $agree;
//存session
$_SESSION['reginfo1'] = $savesession;
checkData($phone, '手机号', 1);
checkData($pw, '密码', 1);
checkData($repw, '确认密码', 1);
if ($pw != $repw) {
    alertInfo("两次输入的密码不同", "userreg.php", 0);
}
/*
	if ($vCode!=$code){
		alertInfo("验证码错误","",1);
	} */
if ($vCode != $_SESSION["imgcode"]) {
    alertInfo("验证码错误", "", 1);
}
if (empty($agree) && $site_isshowprotocol == '1') {
    alertInfo("请选择同意协议", "", 1);
}
//检查手机的存在
$sqlStr = "select user_id from qiyu_user where user_phone='" . $phone . "'";
开发者ID:piapro,项目名称:AIRestaurant,代码行数:31,代码来源:userreg_do.php

示例12: define

define('BASE_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . '../../' . DIRECTORY_SEPARATOR);
define('MODULE_PATH', BASE_PATH . 'modules' . DIRECTORY_SEPARATOR);
//模块文件夹地址
define('MODEL_PATH', BASE_PATH . 'model' . DIRECTORY_SEPARATOR);
//模型文件夹地址
define('CLASS_PATH', BASE_PATH . 'common/libs/classes' . DIRECTORY_SEPARATOR);
//公共类文件夹地址
define('FUNC_PATH', BASE_PATH . 'common/libs/functions' . DIRECTORY_SEPARATOR);
//公共函数文件夹地址
define('CACHE_PATH', BASE_PATH . 'caches' . DIRECTORY_SEPARATOR);
//缓存文件夹路径
require_once FUNC_PATH . 'global.func.php';
require_once CLASS_PATH . 'mysql.class.php';
require_once CLASS_PATH . 'tpl.class.php';
require_once CLASS_PATH . 'Base.class.php';
$getData = checkData($_GET);
$module = 'v3';
if (isset($_SERVER["PATH_INFO"])) {
    list($n, $c, $a) = explode('/', $_SERVER["PATH_INFO"]);
    $control = empty($c) ? 'index' : strtolower($c);
    $action = empty($a) ? 'index' : strtolower($a);
} else {
    $control = !empty($getData['c']) ? $getData['c'] : 'index';
    $action = !empty($getData['a']) ? $getData['a'] : 'index';
}
$controlFile = MODULE_PATH . $module . DIRECTORY_SEPARATOR . $control . '.php';
if (!file_exists($controlFile)) {
    die('Forbidden!');
}
require_once $controlFile;
$name = '\\modules\\' . $module . '\\' . $control;
开发者ID:bibyzhang,项目名称:produce_cms,代码行数:31,代码来源:index.php

示例13: getPostTime

<?php

//our control
//form_catcher.php
require 'model/model.php';
function getPostTime()
{
    return date("Y-m-d h:i:s", time());
}
function checkData()
{
    $data_array = null;
    if (isset($_POST['username']) && isset($_POST['message'])) {
        if ($_POST['username'] != "" && $_POST['message'] != "") {
            $data_array = array("username" => $_POST['username'], "message" => $_POST['message'], "time" => getPostTime());
        }
    }
    return $data_array;
}
if ($data_array = checkData()) {
    writeToFile($data_array);
}
header("Location: index.php");
开发者ID:bensialih,项目名称:chat_new_mvc,代码行数:23,代码来源:form_catcher.php

示例14: sqlReplace

<?php

/**
 * demand.php     提交需求
 */
require 'include/dbconn.php';
$content = sqlReplace(trim($_GET['content']));
checkData($content, '内容', 1);
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "insert into " . WIIDBPRE . "_demand(demand_content,demand_addtime,demand_ip) values('" . $content . "',now(),'" . $ip . "')";
$rs = mysql_query($sql);
if (!$rs) {
    //alertInfo('此收藏已不存在',"usercenter.php?tab=4",0);
    echo '未知原因,提交失败';
} else {
    echo '感谢您的关注,我们会尽快开发您周边的餐厅';
}
开发者ID:piapro,项目名称:AIRestaurant,代码行数:17,代码来源:demand_do.php

示例15: chang_user_pass

 /** 修改帐号密码 */
 public function chang_user_pass()
 {
     $pData = checkData($_POST);
     $AdminUserTable = $this->OperateTable['AdminUserTable'];
     $user_name = $_SESSION['user_id']['user_name'];
     $user_id = $_SESSION['user_id']['user_id'];
     if ($user_name == 'weedong91admin' || $user_id == 1) {
         ajaxReturn('不能修改超级管理员帐号密码', 300);
     }
     $info_sql = "SELECT user_id,user_pass,user_name FROM {$AdminUserTable} WHERE user_id={$user_id} LIMIT 1";
     $infoData = $this->db->get($info_sql);
     $uData['user_id'] = $infoData['user_id'];
     $uData['user_name'] = $infoData['user_name'];
     $uData['user_pass'] = $infoData['user_pass'];
     if ($user_name != $uData['user_name'] || $user_id != $uData['user_id']) {
         ajaxReturn('非法操作[!!!]', 300);
     }
     if ($pData) {
         /*$old_pass = MD5(MD5($pData['old_pass']));
           $user_pass = MD5(MD5($pData['user_pass']));
           $auth_pass = MD5(MD5($pData['auth_pass']));*/
         $old_pass = MD5($pData['old_pass']);
         $user_pass = MD5($pData['user_pass']);
         $auth_pass = MD5($pData['auth_pass']);
         if ($user_pass != $auth_pass) {
             ajaxReturn('两次密码输入不同,请重新输入', 300);
         }
         if ($old_pass != $uData['user_pass']) {
             ajaxReturn('您的旧密码错误,请重新输入', 300);
         }
         $sql = "UPDATE {$AdminUserTable} SET user_pass='{$user_pass}' WHERE user_id=" . $uData['user_id'] . " AND user_pass='" . $uData['user_pass'] . "' LIMIT 1";
         if ($this->db->query($sql)) {
             $this->setLog('修改用户密码{' . $user_name . '}成功!');
             $back_json = '{
                     "statusCode":"200",
                     "message":"修改用户密码{' . $user_name . '}成功!",
                     "callbackType":"closeCurrent"
                 }';
             echo $back_json;
             exit;
         } else {
             $this->setLog('修改用户密码{' . $user_name . '}失败!');
             ajaxReturn('修改用户密码{' . $user_name . '}失败!', 300);
         }
     }
     $this->s->assign('uData', $uData);
     $this->s->display('admin/chang_user_pass.html');
 }
开发者ID:bibyzhang,项目名称:produce_cms,代码行数:49,代码来源:user_grant_admin.php


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