-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreset.php
93 lines (88 loc) · 2.28 KB
/
reset.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
<?php
include("header.php");
if(isset($_POST[changepassword]))
{
$sql = "UPDATE students SET password=$_POST[password] where regno=$_SESSION[regno]";
if(!mysqli_query($con,$sql))
{
die(Error: . mysqli_error($con));
}
else
{
echo "<script>alert(Password updated successfully...);</script>";
echo "<script>window.location=reset.php;</script>";
}
}
?>
<div class="slider_top2">
<h2>Change Password</h2>
</div>
<div class="clr"></div>
<div class="body_resize">
<div class="body">
<div class="left">
<p>
<form name="formname" method="post" action="" onsubmit="return validation()">
<table class="tftable" width="464" height="25%" border="1">
<tr>
<th width="166" height="37%" scope="col">Old Password</th>
<td width="144" scope="col">
<input name="opassword" type="Password" id="opassword" size="30" placeholder="Enter Old Password"></td>
</tr>
<tr>
<th height="20%" scope="row">New Password</th>
<td><label for="new password"></label>
<input name="password" type="password" id="password" size="30" placeholder="Enter New Password"></td>
</tr>
<tr>
<th height="20%" scope="row">Confirm Password</th>
<td><label for="password"></label>
<input name="cpassword" type="password" id="cpassword" size="30" placeholder="Enter Confirm Password"></td>
</tr>
<tr>
<th height="23%" colspan="2" scope="row"><input type="Submit" name="changepassword" id="changepassword" value="Change password"></th>
</tr>
</table>
</form>
</p>
<p> </p>
<p> </p>
</div>
<div class="right">
<?php
include("usersidebar.php");
?>
</div>
<div class="clr"></div>
</div>
</div>
<?php
include("footer.php");
?>
<script type="application/javascript">
function validation()
{
if(formname.opassword.value=="")
{
alert("Old Password should not be empty...");
formname.opassword.focus();
return false;
}
if(formname.password.value=="")
{
alert("Please Enter New Password...");
formname.password.focus();
return false;
}
if(formname.cpassword.value=="")
{
alert("Please Enter Confirm Password...");
formname.cpassword.focus();
return false;
}
else
{
return true;
}
}
</script>