-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify.php
71 lines (63 loc) · 2.13 KB
/
verify.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
<?php
require_once 'lib/class.user.php';
$user = new USER();
if(empty($_GET['id']) && empty($_GET['code'])) {
$user->redirect('index.php');
}
if(isset($_GET['id']) && isset($_GET['code'])) {
$id = base64_decode($_GET['id']);
$code = $_GET['code'];
$statusY = "Y";
$statusN = "N";
$stmt = $user->runQuery("SELECT userid, userstatus FROM users WHERE userid=:userid AND token = :code LIMIT 1");
$stmt->execute(array(":userid"=>$id,":code"=>$code));
$row=$stmt->fetch(PDO::FETCH_ASSOC);
if($stmt->rowCount() > 0)
{
if($row['userstatus'] == $statusN)
{
$stmt = $user->runQuery("UPDATE users SET userStatus=:status WHERE userid=:userid");
$stmt->bindparam(":status",$statusY);
$stmt->bindparam(":userid",$id);
$stmt->execute();
$msg = "
<div class='alert alert-success'>
<button class='close' data-dismiss='alert'>×</button>
<strong>WoW !</strong> Your Account is Now Activated : <a href='index.php'>Login here</a>
</div>
";
} else {
$msg = "
<div class='alert alert-error'>
<button class='close' data-dismiss='alert'>×</button>
<strong>sorry !</strong> Your Account is allready Activated : <a href='index.php'>Login here</a>
</div>
";
}
} else {
$msg = "
<div class='alert alert-error'>
<button class='close' data-dismiss='alert'>×</button>
<strong>sorry !</strong> No Account Found : <a href='register.php'>Signup here</a>
</div>
";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Cutie Foodie - Verify Account</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/site.min.css">
<link rel="stylesheet" href="css/styles.css">
</head>
<body id="login">
<div class="container">
<?php if(isset($msg)) { echo $msg; } ?>
</div> <!-- /container -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/core.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>