-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathactivate.php
65 lines (58 loc) · 1.75 KB
/
activate.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
55
56
57
58
59
60
61
62
63
64
65
<?php
include_once('./includes/common.functions.php');
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Registration Confirmation</title>
<link rel="stylesheet" href="./styles/mainStyle.css" type="text/css"/>
</head>
<body>
<div id="upperPanel">
<?php
include_once('./layout/upperBar.php');
include_once('./layout/searchPanel.php');
?>
</div>
<div id="wrapper">
<div id="loginContent">
<?php
printError();
if(isset($_GET['x']) && isset($_GET['y']))
{
$sql ="SELECT userKey,userState FROM users WHERE userID={$_GET['x']} ";
$result=$mysqli->query($sql)or die("query failed due to ".mysqli_error());
if($result->num_rows==1)
{
$row=$result->fetch_assoc();
$key=$row['userKey'];
$state=$row['userState'];
if($state==0 && $key==$_GET['y'])
{
$sql="UPDATE users SET userKey='NULL',userState=1 WHERE userID={$_GET['x']} ";
$result=$mysqli->query($sql)or die("query failed due to ".mysqli_error());
echo '<div id="loginForm">
your acount has successfully activated,you can now <a href="./login.php"id="hrefBtn">login</a>
</div>';
}
}
}
else if(isset($_GET['x']))
{
echo '<form id="loginForm" action="" method="get"><p id="error">';
echo '<strong>your accout has created successfully activation key has been sent to your email.</strong>';
echo '</p><table id="form">';
echo "<input type=\"hidden\" name=\"x\" value=\"{$_GET['x']}\" />";
echo '<tr><td><label>Activation Key :</label></td><td><input type="text" name="y" required /></td></tr>
<tr><td colspan="2"><input type="submit" name="activate" value="submit"/></td></tr>
</table>
</form>';
}
?>
</div>
</div>
<?php
include_once('./layout/footerBar.php');
?>
</body>
</html>