-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangePassPage.php
More file actions
111 lines (100 loc) · 3.22 KB
/
changePassPage.php
File metadata and controls
111 lines (100 loc) · 3.22 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Change Password</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="bootstrap\css\bootstrap.min.css" rel="stylesheet">
<style>
/* Gradient background */
body {
background: linear-gradient(120deg, #87CEEB, #4682B4);
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
.container {
max-width: 600px;
margin: auto;
padding: 20px;
text-align: center;
}
.card {
background: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.form-group {
margin-bottom: 20px;
}
label {
font-weight: bold;
margin-bottom: 10px;
}
input[type="password"] {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 1px solid #ccc;
}
button[type="submit"] {
width: 100%;
padding: 15px;
font-size: 18px;
background-color: #dc3545;
border: none;
border-radius: 5px;
color: #fff;
cursor: pointer;
transition: background-color 0.3s;
}
button[type="submit"]:hover {
background-color: #c82333;
}
</style>
<script>
function validateForm() {
var currentPassword = document.getElementById("current_password").value;
var newPassword = document.getElementById("new_password").value;
var confirmNewPassword = document.getElementById("confirm_new_password").value;
if (newPassword === currentPassword) {
alert("New password cannot be the same as the current password.");
return false;
}
if (newPassword !== confirmNewPassword) {
alert("New password and confirm password do not match.");
return false;
}
return true;
}
</script>
</head>
<body>
<?php
session_start();
require 'menu.php';
?>
<div class="container">
<div class="card">
<h2>Change Password</h2>
<form method="post" action="changePass.php" onsubmit="return validateForm()">
<div class="form-group">
<label for="current_password">Current Password:</label>
<input type="password" name="current_password" id="current_password" required>
</div>
<div class="form-group">
<label for="new_password">New Password:</label>
<input type="password" name="new_password" id="new_password" required>
</div>
<div class="form-group">
<label for="confirm_new_password">Confirm New Password:</label>
<input type="password" name="confirm_new_password" id="confirm_new_password" required>
</div>
<!-- Change the button type to submit -->
<input type="submit" value="Change Password">
</form>
</div>
</div>
</body>
</html>