예제 #1
0
    header("location:reg.php");
} else {
    $username = mysqli_real_escape_string($dbc, trim($_POST['username']));
    $pwd = mysqli_real_escape_string($dbc, trim($_POST['password']));
    $email = mysqli_real_escape_string($dbc, trim($_POST['email']));
    $code = mysqli_real_escape_string($dbc, trim($_POST['code']));
    setcookie("reg_name", $username, time() + 60);
    setcookie("reg_email", $email, time() + 60);
    setcookie("reg_code", $code, time() + 60);
}
$pwd = md5($pwd);
$okk = 0;
//验证码
//邀请码检测
if ($invite_only) {
    $ic = new invite_code($code);
    if ($ic->invite_code_test() == 0) {
        $okk = 0;
        echo ' <script>alert("邀请码无效!")</script> ';
        echo " <script>window.location='reg.php';</script> ";
    } else {
        $okk = 1;
    }
} else {
    $okk = 1;
}
//验证均通过
if ($okk) {
    $info_ok = 1;
    //用户名检测
    if ($u->is_username_used($username) == 0) {
예제 #2
0
<?php

//引入配置文件
require_once 'user_check.php';
include_once 'lib/header.inc.php';
$sub = $_POST['code_sub'];
$type = $_POST['code_type'];
$num = $_POST['code_num'];
$c = new invite_code();
$c->add_code($sub, $type, $num);
echo ' <script>alert("添加成功!")</script> ';
echo " <script>window.location='invite.php';</script> ";