-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreset_pwd.php
58 lines (53 loc) · 1.11 KB
/
reset_pwd.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
<?php
if(isset($_REQUEST['uid'])){
$id=$_REQUEST['uid'];
}
else{
header("loaction:Welcome.php");
}
?>
<html>
<head>
<title>RESET PASSWORD</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div="container">
<?php include("menu.php"); ?>
<div='body-content'>
<?php
include("connect.php");
if(isset($_POST['Update'])){
$pwd=$_POST['pwd'];
$cpwd=$_POST['cpwd'];
if($pwd==$cpwd){
mysqli_query($con,"update reg set Password='$pwd' where Id='$id'");
if(mysqli_affected_rows($con)>0){
echo "Password chnaged successfully. Login to continue";
}
}
else{
echo "Password don't match";
}
}
?>
<form action="" method="POST">
<table>
<tr>
<td><label>Enter New Password</label></td>
<td><input type="password" name="password" id="pwd"></td>
</tr>
<tr>
<td><label>Confirm entered Password</label></td>
<td><input type="password" name="cpassword" id="cpwd"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="Update" value="Update"></td>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>