Repository navigation
Expand file tree
/
Copy pathreset_password.php
More file actions
75 lines (63 loc) · 2.74 KB
/
Copy pathreset_password.php
File metadata and controls
75 lines (63 loc) · 2.74 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>Library Management System</title>
<script>
document.querySelector('form').addEventListener('submit', function(event) {
if (!validateForm()) {
event.preventDefault(); // Prevent form submission if validation fails
}
});
function validateForm() {
var password = document.forms["signupForm"]["NewPassword"].value;
var passwordPattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]).{8,14}$/;
if (!passwordPattern.test(password)) {
alert("Password must be between 8 and 14 characters and contain at least one special symbol.");
return false;
}
return true;
}
</script>
</head>
<body>
<!-- <div class="container1"> -->
<!--header start-->
<!-- <header class="page-head">
<p></p>
</header> -->
<?php if (isset($_GET['email'])) {
$email = htmlspecialchars($_GET['email']);
} else {
echo "<p>Email parameter is missing. Please use the link from your email to reset your password.</p>";
exit;
}
?>
<div class="clear"></div>
<div class="main-contain">
<div class="welcome"><p> <t>Welcome to our library.<br><br>Making your experience easier.</p></div>
<div class="wrapper">
<form action="update_password.php" method="post">
<h1>Forgot Password</h1>
<div class="input-box">
<input type="hidden" name="Email" value="<?php echo $email; ?>">
</div>
<div class="input-box">
<input type="text" name="VerificationCode" placeholder="Verification Code" required>
</div>
<div class="input-box">
<input type="password" name="NewPassword" placeholder="Enter New Password" required>
</div>
<button type="submit" class="btn">Reset Password</button>
<div class="register-link">
<p>Having verification error? Register again. <a href="register.php">Register</a></p>
<!-- <p>Already have an account? <a href="indexA.php"> Login Now!</a></p> -->
</div>
</form>
</div>
</div>
</div>
</body>
</html>