-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate_password.php
50 lines (46 loc) · 1.23 KB
/
update_password.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
<?php
if(isset($update))
{
$sql=mysqli_query($con,"select * from admin where username='$admin' and password='$op' ");
if(mysqli_num_rows($sql))
{
if($np==$cp)
{
mysqli_query($con,"update admin set password='$np' where username='$admin' ");
echo "<h3 style='color:blue'>Password updated successfully</h3>";
}
else
{
echo "<h3 style='color:red'>New and confirm doesn't match</h3>";
}
}
else
{
echo "<h3 style='color:red'>Old Password doesn't match</h3>";
}
}
?>
<form method="post" enctype="multipart/form-data">
<table class="table table-bordered table-striped table-hover">
<h1>Update Password</h1><hr>
<tr style="height:40">
<th>Enter Your old Password</th>
<td><input type="password" name="op" class="form-control"required/></td>
</tr>
<tr>
<th>Enter Your New Password</th>
<td><input type="password" name="np" class="form-control"required/>
</td>
</tr>
<tr>
<th>Enter Your Confirm Password</th>
<td><input type="password" name="cp" class="form-control"required/>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" class="btn btn-primary" value="Update Password" name="update"required/>
</td>
</tr>
</table>
</form>