-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactivation.php
executable file
·75 lines (56 loc) · 1.73 KB
/
activation.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
66
67
68
69
70
71
72
73
74
75
<?php
require "php/db.php";
$msg='';
if(!empty($_GET['code']) && isset($_GET['code']))
{
$code= $db->real_escape_string($_GET["code"]); // получаем значение code из строки браузера
$c=$db->query("SELECT id FROM users WHERE active='$code'");
if($c->num_rows > 0)
{
$count=$db->query("SELECT id FROM users WHERE active='$code' and status='0'");
if($count->num_rows == 1)
{
$db->query("UPDATE users SET status='1' WHERE active='$code'");
$msg="Спасибо ваш аккаунт активирован ";
}
else
{
$msg ="Ваш аккаунт уже был актирвирован ";
}
}
else
{
$msg ="Такой аккаунт не существует ";
}
}
$db->close();
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Проект</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/chosen.css">
<link rel="stylesheet" href="css/stile.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<div id="wrap">
<div class="content" id="conttext">
<div id="activetext2">
<?php echo $msg;?>
</div>
</div>
</div>
</body>
</html>
<script>
function func() {
window.location='userlogin.php';
}
setTimeout(func, 5000);
</script>