-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconformpasscode.php
More file actions
25 lines (23 loc) · 833 Bytes
/
Copy pathconformpasscode.php
File metadata and controls
25 lines (23 loc) · 833 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
<!--Display form to set new password -->
<?php
// Database connection
$conn = new mysqli('localhost', 'root', 'password', 'hoteltbl');
// Get token from URL
if (isset($_GET['token'])) {
$token = $_GET['token'];
// Check if token exists in the password_resets table
$result = $conn->query("SELECT * FROM password_resets WHERE token='$token'");
if ($result->num_rows > 0) {
// If valid token, show the password reset form
?>
<form action="reset_password.php" method="POST">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="password" name="new_password" placeholder="Enter new password" required>
<button type="submit">Reset Password</button>
</form>
<?php
} else {
echo "Invalid token!";
}
}
?>