if (Getuname($nick) > 0) { $arry['id'] = 102; $arry['msg'] = "用户名已被占用"; echo json_encode($arry); exit; } $sql_e = "select * from user where email='{$email}'"; $result_e = mysql_query($sql_e); $count_e = mysql_num_rows($result_e); if ($count_e > 0) { $arry['id'] = 102; $arry['msg'] = "邮箱已被占用"; echo json_encode($arry); exit; } if (!Getuname($nick) || !Chmatch($pwd)) { $ucpwd = $pwd; $pwd = md5($pwd); $sql = "insert into user set email='{$email}',password='******',name='{$nick}',us_type={$us_type},signinday=0,jifen=0,ip='" . $_SERVER['REMOTE_ADDR'] . "',regtime=" . $CCtimes . ",lastlogintime=" . $CCtimes; $result = mysql_query($sql); $count = mysql_affected_rows(); $user_rowid = mysql_insert_id(); if ($count > 0) { $_SESSION['usnamese'] = $nick; $_SESSION['usidse'] = $user_rowid; $_SESSION['us_type'] = $us_type; Kjifen($_SESSION['usnamese'], $SK['zhucesongfen'], $SK['MingxiC'] . '(' . $nick . ')'); if (isset($_POST["exid"])) { $exid = trim($_POST["exid"]); $sql_ex = "select name from user where id='{$exid}'"; $result_ex = mysql_query($sql_ex);
} else { echo "<script>message('你输出的地址连接不正确',4);</script>"; } $pawedit = $_POST['pawedit']; if ($pawedit == 1) { $pwd = trim($_POST['pwd']); $rpwd = trim($_POST['rpwd']); if ($pwd != $rpwd) { echo "<script>message('两次输入的密码不一致',4);</script>"; exit; } if (strlen($pwd) < 6) { echo "<script>message('密码长度不能小于6位',4);</script>"; exit; } if (Chmatch($pwd)) { echo "<script>message('密码不能包含中文',4);</script>"; exit; } if (empty($pwd)) { echo "<script>message('密码不能为空',4);</script>"; exit; } else { $userpasswdmdw = md5($pwd); $newtime = date('Y-m-d H:i:s', strtotime('-1day')); $em_end_time = date('Y-m-d H:i:s', time() - 7200); $sql = "update user set password='******',StartTime='{$newtime}' where email = '{$usemail}' and StartTime>'{$em_end_time}'"; mysql_query($sql); $count = mysql_affected_rows(); if ($count > 0) { echo "<script>message('您的密码修改成功,请记着你的密码为:" . $pwd . "',4);location='login.php'</script>";