-
Notifications
You must be signed in to change notification settings - Fork 2
/
Join.php
54 lines (54 loc) · 1.85 KB
/
Join.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
if (!empty($_POST['nuser']) && !empty($_POST['npassword']) && !empty($_POST['IvCode']))
{
require_once "./status/DatabaseCon.php";
require "./scripts/client_ip.php";
require "./scripts/PasswordWays.php";
$PasswordWaysH = new PasswordWaysH;
$nuser = $_POST['nuser'];
$npassword = $PasswordWaysH->MakeHash($_POST['npassword']);
$IvCode = $_POST['IvCode'];
$CheckIvCodeSql = "SELECT ID FROM SYSTEM_IVCODE WHERE CODE = ?;";
$RunCheckIv = $xlink->prepare($CheckIvCodeSql);
$RunCheckIv->execute(array($IvCode));
$CheckingIV = $RunCheckIv->fetchAll(PDO::FETCH_COLUMN, 0);
if (empty($CheckingIV))
{
echo "GG!错误的邀请码";
echo "<script>location.replace('https://cn.bing.com')</script>";
}
else
{
$CheckUserExistsSql = "SELECT ID FROM SYSTEM_LOGIF WHERE NAME =?;";
$RunCheckUserName = $xlink->prepare($CheckUserExistsSql);
$RunCheckUserName->execute(array($nuser));
$CheckingUN = $RunCheckUserName->fetchAll(PDO::FETCH_COLUMN, 0);
if (!empty($CheckingUN))
{
echo "更换用户名后重试";
echo "<script>location.reload()</script>";
}
else
{
$AddUserSql = 'INSERT INTO SYSTEM_LOGIF (NAME,PASSWORD,ADMIN,IP) VALUES (?,?,0,?);';
$RunAddUser = $xlink->prepare($AddUserSql);
$RunAddUser->execute(array($nuser,$npassword,clientIP()));
echo "Enjoy it!";
}
}
exit;
}
?>
<html>
<head>
<title>加入我们!</title>
</head>
<body>
<form action="" method='POST'>
用户名:<input type='text' name='nuser' required /></br>
密码:<input type='password' name='npassword' required /></br>
邀请码:<input type='password' name='IvCode' required /></br>
<input type='submit' value='Submit' />
</form>
</body>
</html>