注册时候显示 注册失败,请在代理处注册
解决方法:
网站 /sdk/User/user_registe 里面的index.php
改成
- <?php
error_reporting(0);
header(“Content-type: text/html; charset=utf8”);
$sj = base64_decode(file_get_contents(‘php://input’));
$arr = json_decode($sj);
$account = $arr->account;
$password = $arr->password;
$game_appid =$arr->game_appid;
$md5_sign = $arr->md5_sign;
$game_id = $arr->game_id;
$promote_id = $arr->promote_id;
include’../../../config.php’;
if($account ==”” || $password ==””){
exit;
}
$sql = “select * from `account` where account=’$account'”;
$res = mysql_fetch_row(mysql_query($sql));
if($res > 0){
$msg = base64_encode(‘{“status”:0,”return_code”:”fail”,”return_msg”:”注册失败,帐号已存在”}’);
echo $msg;
exit;
}
if($game_appid != “”){
$game_appid = ‘安卓注册’;
}else{
$game_appid = ‘苹果注册’;
}
$sql = “INSERT INTO `account` ( `account`, `password`, `game_appid`, `game_id`, `md5_sign`, `promote_id` ) VALUES (‘$account’, ‘$password’, ‘$game_appid’, ‘$game_id’, ‘$md5_sign’, ‘$promote_id’);”;
if(mysql_query($sql)){
$date = date(“Y-m-d H:i:s”);
$newpwd =md5($password . md5($password) . $password);
mysql_query(“insert into `Zx_Agent`.`cly_users` ( `user`,`pwd`,`regtime`,`ip`,`status`,`ParentID`) values (‘$account’, ‘$newpwd’, ‘$date’, ‘127.0.0.1’,’0′,’0′)”);
$msg = base64_encode(‘{“status”:1,”return_code”:”success”,”return_msg”:”注册成功”}’);
}else{
$msg = base64_encode(‘{“status”:0,”return_code”:”fail”,”return_msg”:”注册失败:21″}’);
}
mysql_close($link);
echo $msg;
?>
复制代码
或者
解压覆盖上去。