-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify.php
More file actions
33 lines (23 loc) · 745 Bytes
/
Copy pathverify.php
File metadata and controls
33 lines (23 loc) · 745 Bytes
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
<?php
require_once "db.inc";
$supplied_key = $db->real_escape_string ($_GET["key"]);
$rows = $db->query("SELECT * FROM user WHERE verify_code = '$supplied_key' LIMIT 1");
if ($rows->num_rows == 0){
print "Invalid code";
exit;
}
while ($row = $rows->fetch_object()) {
$id = $row->id;
$row_name = $row->name;
$verified = $row->verified;
if ($verified == 0){
$db->query("UPDATE user SET verified = 1 WHERE verify_code = '$supplied_key' LIMIT 1");
print "Thank you $row_name<br>";
print "Your account has now been activated.";
} else {
print "Your account has already been activated<br>";
}
$homeurl = "http://".$_SERVER["SERVER_NAME"];
print "You may now <a href=\"$homeurl\">Login</a>";
}
?>