-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchangepassword.php
135 lines (130 loc) · 4.39 KB
/
changepassword.php
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
include("config.php");
if(isset($_POST['change'])) {
$id = $_GET['ID'];
$password = $_POST['PASSWORD'];
$repassword = $_POST['REPASSWORD'];
if($password === $repassword) {
$sql = "UPDATE normaluser SET PASSWORD = '{$password}' WHERE ID = $id";
mysqli_query($conn, $sql) or die("Update query not running");
echo '<script>alert("Password Update Successful");
window.location="login.php"</script>';
} else {
echo '<script>alert("Password Does not Matched");
window.location="changepassword.php"</script>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=No">
<link rel="stylesheet" type="text/css" href="files/css/bootstrap.css">
<script type="text/javascript" src="files/js/bootstrap.js"></script>
<script type="text/javascript" src="files/js/bootstrap.bundle.js"></script>
<link rel="stylesheet" type="text/css" href="fontawesome/css/all.css">
<link rel="stylesheet" type="text/css" href="navbar.css">
<link rel="icon" href="images/logo1.png">
<title>Prostay</title>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
.text-yellow {
color: #FFED46;
}
.bg-yellow {
background-color: #FFED46;
}
form {
max-width: 600px;
margin-right: auto;
margin-left: auto;
padding: 20px;
}
@media (max-width: 992px) {
}
@media (max-width: 425px) {
.navbar-brand {
max-height: 9vh;
}
}
@media (max-width: 345px) {
.navbar-brand {
max-height: 8vh;
}
}
@media (max-width: 256px) {
.navbar-brand {
max-height: 5vh;
}
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
<a href="index.php"><img class="navbar-brand logo-shift" src="images/logo-black.png" alt="logo"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="index.php">HOME <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="pg.php">PG's</a>
</li>
<li class="nav-item">
<a class="nav-link" href="partners.php">PARTNER WITH US</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php">ABOUT</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.php">CONTACT</a>
</li>
<li class="nav-item">
<a class="nav-link" href="blogs.php">BLOG</a>
</li>
<?php
if(isset($_SESSION['EMAIL'])) {
?>
<li class="nav-item">
<a class="nav-link" href="logout.php">LOGOUT</a>
</li>
<?php } else { ?>
<li class="nav-item">
<a class="nav-link" href="signup.php">SIGNUP</a>
</li>
<li class="nav-item">
<a class="nav-link" href="login.php">LOGIN</a>
</li>
<?php } ?>
</ul>
</div>
</nav>
<div class="container" style="margin-top: 85px;">
<h1 class="text-center">Change Password</h1>
<hr class="bg-yellow" style="height: 2px;">
<form class="shadow" action="<?php $_SERVER['PHP_SELF'];?>" method="post">
<div class="form-group">
<label>New Password *</label>
<input type="password" class="form-control" placeholder="Create New Password" name="PASSWORD" required />
</div>
<div class="form-group">
<label>Confirm Password *</label>
<input type="password" class="form-control" placeholder="Confirm Password" name="REPASSWORD" required />
</div>
<div align="center">
<input type="submit" class="btn bg-yellow" value="Change" name="change"/>
</div>
</form>
</div> <!-- container div -->
<br>
<!-- footer -->
<?php include("footer.php"); ?>
</body>
</html>