-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchpass.php
More file actions
executable file
·115 lines (99 loc) · 3.05 KB
/
chpass.php
File metadata and controls
executable file
·115 lines (99 loc) · 3.05 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
112
113
114
115
<?php
session_start();
include("header.php");
?>
<!----------Change Password FORM START--------------------->
<script language="javascript">
function isEmpty(s)
{ return ((s == null) || (s.length == 0))
}
// BOI, followed by one or more whitespace characters, followed by EOI.
var reWhitespace = /^\s+$/
// BOI, followed by one or more characters, followed by @,
// followed by one or more characters, followed by .,
// followed by one or more characters, followed by EOI.
var reEmail = /^.+\@.+\..+$/
var defaultEmptyOK = false
// Returns true if string s is empty or
// whitespace characters only.
function isWhitespace (s)
{ // Is s empty?
return (isEmpty(s) || reWhitespace.test(s));
}
function validate(){
if(isWhitespace(document.frm_chpass.opwd.value))
{
alert('Please enter old password');
return false;
}
if(document.frm_chpass.pwd.value != document.frm_chpass.pwd1.value){
alert("The new passwords dont match. Please re-enter.");
return false;
}
if(document.frm_chpass.pwd.value.length < 6){
alert("The new password should be atleast 6 characters long.");
return false;
}
return true;
}
</script>
<div class="container first_image">
<FORM name=frm_chpass action=process_details.php method=POST>
<table width=770 cellpadding=2 cellspacing=0>
<tr bgcolor="dedede"><td ><b>Change Password </b></td>
<td align=right>
</td>
</tr>
<tr>
<td colspan=2 style="color:red;text-align:right;font-weight:bold;">
<?php
if ($_GET['cmd'] == "incorrectopwd")
print("Sorry, the old password was not correct.");
?>
</td>
</tr>
<tr>
<td align=right>Email Address :</td>
<td><b>
<?php
if (isset($_SESSION['userid'])){
include("./db.php");
$result = mysql_query("SELECT user_email FROM migwatch_users WHERE user_id=".$_SESSION['userid']);
if($result){
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
$email = $row{'user_email'};
}
print ($email);
}
else
die("Session not available. Fatal error.");
?>
</b></td>
</tr>
<tr><td align=right>Enter Current Password :</td>
<td><input type=password name=opwd style="width:200px;" maxlength=20> *</td>
</tr>
<tr>
<td align=right>Enter New Password :</td>
<td><input type=password name=pwd style="width:200px;" maxlength=20> *</td>
</tr>
<tr>
<td align=right>Reenter New Password :</td>
<td><input type=password name=pwd1 style="width:200px;" maxlength=20> *</td>
</tr>
<tr>
<td> </td>
<td>
<input type=submit value= "Change Password" class=buttonstyle onclick="javascript:return validate();">
<input type=hidden name="cmd" value="chpass" />
</td>
</tr>
<tr><td colspan=2><br><li><b>Asterisks (*) indicate required fields.</b></td></tr>
</table>
</form>
</div>
<!---------Change Password FORM END----------------------->
<?php
include('footer.php');
?>