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


PHP _check_code函数代码示例

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


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

示例1: header

<?php

header('Content-Type: text/html; charset=utf-8');
session_start();
define('IN_TG', true);
//定义常量 IN_TG 用来授权 includes里的文件调用 防止恶意调用 外部网站无法调用
//定义一个常量来代表本页的内容
define('script', 'register');
//引入公共文件 下面这种方法比较快
require dirname(__FILE__) . '/includes/common.php';
if ($_GET['action'] == 'register') {
    //get可以获取url的参数
    /*验证验证码是否正确  post获取表单提交的内容 因为表单是以post形式提交的*/
    _check_code($_POST['yzm'], $_SESSION['code']);
    //可以通过唯一标识符 来防止表单恶意注册 跨站攻击
    include root . 'includes/register.php';
    /*定义一个变量存放 各字段的值*/
    $_clear = array();
    /*字段在验证成功后 将字符串 返回出来 并赋值给 $_clear 相应的字段 -->验证并赋值*/
    $_clear['uniqid'] = _check_uniqid($_POST['uniqid'], $_SESSION['uniqid']);
    $_clear['active'] = _sha1_uniqid();
    $_clear['username'] = _check_username($_POST['username']);
    $_clear['password'] = _check_password($_POST['password'], $_POST['notpassword'], 6);
    $_clear['question'] = _check_questions($_POST['passt'], 4, 20);
    $_clear['anwser'] = _check_anwser($_POST['passt'], $_POST['passd'], 4, 20);
    $_clean['sex'] = $_POST['sex'];
    $_clean['face'] = $_POST['face'];
    $_clear['email'] = _check_email($_POST['email']);
    $_clear['qq'] = _check_qq($_POST['qq']);
    $_clear['url'] = _check_url($_POST['url']);
    print_r($_clear);
开发者ID:lilili001,项目名称:think,代码行数:31,代码来源:register.php

示例2: session_start

    session_start();
}
if (!isset($_SESSION)) {
    session_start();
}
//define the constant IN_TG to include common.inc.php
define('IN_TG', true);
//a constant for different scripts calling
define("SCRIPT", "member_modify");
//include common.inc.php
require dirname(__FILE__) . '/includes/common.inc.php';
//Update information
if (isset($_GET['action'])) {
    if ($_GET['action'] == 'modify') {
        //protect from illegal registration
        _check_code($_POST['code'], $_SESSION['RandCode']);
        //make sure this user does exist
        if (!!($_rows = _fetch_array("select \n\t\t\t\t\t\t\t\t\t\t                     tg_uniqid \n\t\t\t\t\t\t\t\t\t                   from \n\t\t\t\t\t\t\t\t\t\t                     tg_user \n\t\t\t\t\t\t\t\t\t                where \n\t\t\t\t\t\t\t\t\t\t                     tg_username = '{$_COOKIE['username']}'\n\t\t\t\t\t\t\t\t\t                  limit 1"))) {
            //Protect from faking unique identifier
            _uniqid($_rows['tg_uniqid'], $_COOKIE['uniqid']);
            //include register.func.php
            include ROOT_PATH . 'includes/check.func.php';
            $_clean = array();
            $_clean['password'] = _check_modify_password($_POST['password']);
            $_clean['sex'] = _check_sex($_POST['sex']);
            $_clean['face'] = _check_profile($_POST['face']);
            $_clean['email'] = _check_email($_POST['email']);
            $_clean['msn'] = _check_msn($_POST['msn']);
            $_clean['url'] = _check_url($_POST['url']);
            $_clean['switch'] = $_POST['switch'];
            $_clean['autograph'] = _check_autograph($_POST['autograph']);
开发者ID:Zhiming,项目名称:PHP,代码行数:31,代码来源:member_modify.php


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