-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_email.php
More file actions
40 lines (31 loc) · 827 Bytes
/
verify_email.php
File metadata and controls
40 lines (31 loc) · 827 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
34
35
36
37
<!DOCTYPE html>
<html>
<head>
<title>User Email Verification</title>
</head>
<body>
<?php
require_once("./includes/initialize.php");
if (isset($_GET['token'])) {
$conn=$database->open_connection();
$token = $_GET['token'];
$sql = "SELECT * FROM users WHERE token='$token' LIMIT 1";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
$user = mysqli_fetch_assoc($result);
$query = "UPDATE users SET verified=1 WHERE token='$token'";
if (mysqli_query($conn, $query)) {
$msg = "Your email address has been verified successfully";
// header('location: login.php');
exit(0);
}
} else {
$msg="User not found!";
}
} else {
$msg="No token provided!";
}
?>
<p><?php echo $msg; ?></p>
</body>
</html>