-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify.php
More file actions
41 lines (29 loc) · 912 Bytes
/
verify.php
File metadata and controls
41 lines (29 loc) · 912 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
38
<?php
$host = "localhost";
$user = "root";
$pass = "";
$dbname = "rdbms";
$conn = new mysqli($host, $user, $pass, $dbname);
if ($conn->connect_error) {
die('Connection failed: ' . $conn->connect_error);
} else {
if (isset($_GET['email']) && isset($_GET['code']))
{
$verificationCode=$_GET['code'];
$email=$_GET['email'];
$sql = "UPDATE signin SET verified = 1 WHERE code = ? AND email = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param('ss', $verificationCode, $email);
if ($stmt->execute()) {
// Verification successful
echo 'Email verified successfully. You can now log in.';
} else {
// Verification failed
echo 'Email verification failed. Please try again or contact support.';
}
// Close the database connection
$stmt->close();
$conn->close();
}
}
?>