All Data Structures Namespaces Files Functions Variables Pages
register.php
Go to the documentation of this file.
<?php
define('CURSCRIPT', 'register');
require './include/common.inc.php';
include './include/user.func.php';
include './gamedata/banlist.list';
if(isset($cuser) && isset($cpass)){
gexit($_ERROR['logged_in'],__file__,__line__);
}
if(!isset($cmd)){
//$ustate = 'register';
$icon = 0;
$gender = 'm';
$iconarray = get_iconlist();
$select_icon = 0;
$motto = $criticalmsg = $killmsg = $lastword = '';
include template('register');
}elseif($cmd = 'post_register'){
//$ustate = 'register';
$gamedata = Array();
$name_check = name_check($username);
$pass_check = pass_check($npass,$rnpass);
$onlineip = real_ip();
if($name_check!='name_ok'){
$gamedata['innerHTML']['info'] = $_ERROR[$name_check];
}elseif($pass_check!='pass_ok'){
$gamedata['innerHTML']['info'] = $_ERROR[$pass_check];
}elseif(preg_match($iplimit,$onlineip)){
$gamedata['innerHTML']['info'] = $_ERROR['ip_banned'];
}else{
$result = $db->query("SELECT * FROM {$tablepre}users WHERE username = '$username'");
if($db->num_rows($result) > 0) {
$gamedata['innerHTML']['info'] = $_ERROR['name_exists'];
}else{//现在开始注册
$groupid = 1;
$credits = 0;
$password = md5($npass);
$result = $db->query("INSERT INTO {$tablepre}users (username,password,groupid,ip,credits,gender,icon,motto,killmsg,lastword) VALUES ('$username', '$password', '$groupid', '$onlineip', '$credits', '$gender', '$icon', '$motto', '$killmsg', '$lastword')");
if($result){
$gamedata['innerHTML']['info'] = $_INFO['reg_success'];
$ustate = 'check';
gsetcookie('user',$username);
gsetcookie('pass',$password);
}else{
$gamedata['innerHTML']['info'] = $_ERROR['db_failure'];
$gamedata['innerHTML']['info'] .= ob_get_contents();
}
}
}
if($ustate == 'check'){
$gamedata['innerHTML']['postreg'] = '<input type="button" name="back" value="返回游戏首页" onclick="window.location.href=\'index.php\'">';
if(isset($error)){$gamedata['innerHTML']['error'] = $error;}
ob_clean();
$jgamedata = compatible_json_encode($gamedata);
echo $jgamedata;
ob_end_flush();
}else{
ob_clean();
if(isset($error)){$gamedata['innerHTML']['error'] = $error;}
$jgamedata = compatible_json_encode($gamedata);
echo $jgamedata;
ob_end_flush();
}
}
?>
$gamedata
$gamedata
Definition: command.php:45
$credits
$credits
Definition: login.php:116
pass_check
pass_check($pass, $rpass)
Definition: user.func.php:14
$iconarray
$iconarray
Definition: user.php:92
$db
$db
Definition: clear.php:32
real_ip
real_ip()
Definition: user.func.php:33
$_INFO
$_INFO
Definition: resources_1.php:1030
elseif
【生存者数：<?php echo $alivenum?> 人】< input type="button"value="显示全部幸存者"onClick="$('alivemode').value='all';$('gbmode').value='none';postCmd('alive','alive.php');"></p > if($gamblingon &&$gamestate >=20) elseif($gamblingon &&$gamestate<=10)
Definition: 1_alive.tpl.php:18
$password
if(strpos($username,'Yoshiko')!==false) if(preg_match($iplimit, $onlineip)) $password
Definition: login.php:114
$iplimit
$iplimit
Definition: banlist.php:4
name_check
if(!defined('IN_GAME')) name_check($username)
Definition: user.func.php:7
$error
$error
Definition: errorpage.php:2
$_ERROR
$_ERROR
Definition: resources_1.php:1044
$jgamedata
$jgamedata
Definition: alive.php:173
$pass_check
$pass_check
Definition: login.php:65
$gender
$gender
Definition: login.php:117
gsetcookie
gsetcookie($var, $value, $life=0, $prefix=1)
Definition: global.func.php:107
$name_check
$name_check
Definition: login.php:64
gexit
gexit($message= '', $file= '', $line=0)
Definition: global.func.php:30
$groupid
$groupid
Definition: login.php:115
$onlineip
if($name_check!='name_ok') elseif($pass_check!='pass_ok') $onlineip
Definition: login.php:82
$select_icon
$select_icon
Definition: user.php:93
$cmd
$cmd
Definition: botservice.php:51
$result
if(!$cuser||!$cpass) $result
Definition: admin.php:25
$cpass
$cpass
Definition: common.inc.php:207
compatible_json_encode
compatible_json_encode($data)
Definition: global.func.php:185
get_iconlist
get_iconlist()
Definition: user.func.php:95