-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_code.php
More file actions
36 lines (31 loc) · 834 Bytes
/
verify_code.php
File metadata and controls
36 lines (31 loc) · 834 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
<?php
session_start();
$error = "";
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$code = $_POST['code'];
if (isset($_SESSION['reset_code']) && $_SESSION['reset_expires'] > time()) {
if ($code == $_SESSION['reset_code']) {
header("Location: reset_password.php");
exit;
} else {
$error = "Invalid code.";
}
} else {
$error = "Code expired.";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Verify Code</title>
</head>
<body>
<h2>Enter Verification Code</h2>
<?php if (!empty($error)) echo "<p style='color:red;'>$error</p>"; ?>
<form method="POST">
<input type="text" name="code" placeholder="Enter code" required><br>
<button type="submit">Verify</button>
</form>
</body>
</html>