-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathactivate.php
More file actions
76 lines (58 loc) · 2 KB
/
activate.php
File metadata and controls
76 lines (58 loc) · 2 KB
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
76
<? ob_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Title</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
</head>
<body style= "margin-left: 20%">
<?php
include 'core/init.php';
logged_in_redirect();
if (isset($_GET['success']) == true && empty($_GET['success']) == true) {
?>
<h2 class="congrats">
Thank You,
</h2>
<p class="register">Your registration is complete. Your account has been created<Br /> and now you are free to login and enjoy the special benefits.<Br />By logging in, you will be able to test how much you know.<Br /> You are very important to us.
<Br /><Br />
Thank You for joining <B>website</B>. I hope<Br /> you like our service and let us know if you want anything<Br /> to be updated or your suggestions.<Br /><BR />
Thank You<Br />
<a href="index.php" style="text-decoration:none">
Website
</a>
</p>
<?php
}
else if(isset($_GET['email'], $_GET['email_code']) == true) {
$email = trim($_GET['email']);
$email_code = trim($_GET['email_code']);
$com = "SELECT * FROM users WHERE email = '$email' AND email_code = '$email_code' AND active = 0";
$comd = $conn->query($com);
$sql2 = "SELECT * FROM users WHERE email = '$email'";
$result2 = $conn->query($sql2);
if ($result2->num_rows == 0) {
$errors[] = 'Oops! Something went Wrong and we cannot find that email address!';
}
else if($comd->num_rows == 0) {
$errors[] = 'We had problems activating your account.';
}
if (empty($errors) == false) {
?>
<h2> Oops</h2>
<?php
echo output_errors($errors);
} else {
$conn->query("UPDATE users SET active = 1 WHERE email = '$email'");
header ("Location: activate.php?success");
exit();
}
} else {
header("Location: index.php");
exit();
}
?>
</body>
</html>
<? ob_flush(); ?>