-
Notifications
You must be signed in to change notification settings - Fork 1
/
passwordchange1.html
172 lines (86 loc) · 2.82 KB
/
passwordchange1.html
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php
include('headerinclude.html');
if (isset($_POST['submit']))
{
$usrname = ($_SESSION['SESS_MEMBER_USERNAME']);
$passwd = ($_SESSION['SESS_MEMBER_PASSWORD']);
$oldpasswd = $_POST['oldpasswd'];
$newpasswd = $_POST['newpasswd'];
$cfmpasswd = $_POST['cfmpasswd'];
}
if ($submit)
{
// Check if Old password is the correct
if ($oldpasswd != $passwd)
{ echo "Old password is wrong!"; exit; }
// Check if New password if blank
if (trim($newpasswd) == "")
{ echo "New password cannot be blank!"; exit; }
// Check if New password is confirmed
if ($newpasswd != $cfmpasswd)
{ print "New password was not confirmed!"; exit; }
}
// If everything is ok, use auth class to modify the record
$query = "UPDATE smw_members ".
"SET usrname = '$usrname', newpasswd = '".md5($_POST['newpasswd'])."' ".
"WHERE member_id = '$member_id'";
mysql_query($query) or die('Error : ' . mysql_error());
?>
<html>
<head>
<title>Scotty Media Content Management System</title>
<?php
include('headerinclude.html');
?>
</head>
<body>
<table border="1" width="1000" align="center" cellpadding="0" cellspacing="0">
<tr valign="top">
<?php include("itop_bar.php"); ?>
</tr>
<tr valign="top">
<td width="213" bgcolor="#404040">
<?php include("iside_bar.php"); ?>
</td>
<td width="787">
<table border="0" width="100%">
<tr>
<?php include("iquick_bar.php"); ?>
</tr>
<tr>
<td valign="top" colspan="2">
<hr align="left" width="770" align="center">
</td>
</tr>
<tr>
<td valign="top" class="txt_main" colspan="2">
<form method="POST" action="chgpwd.php">
<table>
<tr>
<td width="30%">Old Password:</td>
<td width="70%"><input type="password" name="oldpasswd"></td>
</tr>
<tr>
<td width="30%">New Password:</td>
<td width="70%"><input type="password" name="newpasswd" size="25"></td>
</tr>
<tr>
<td width="34%">Confirm:</td>
<td width="66%"><input type="password" name="cfmpasswd" size="25"></td>
</tr>
<tr>
<td width="100%" colspan="2" align="center"><input type="submit" value="Change Password" name="submit"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<?php include("ibottom_bar.php"); ?>
</tr>
</table>
</body>
</html>