-
Notifications
You must be signed in to change notification settings - Fork 1
/
change_pass_gu.php
230 lines (181 loc) · 6.53 KB
/
change_pass_gu.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
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN" dir="ltr">
<head profile="http://gmpg.org/xfn/11">
<title>SPAM</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imaPOSToolbar" content="no" />
<link rel="stylesheet" href="styles/layout.css" type="text/css" />
<script type="text/javascript" src="scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="scripts/jquery.slidepanel.setup.js"></script>
<script type="text/javascript" src="scripts/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="scripts/jquery.tabs.setup.js"></script>
<style type="text/css">
<!--
A.ssmItems:link {color:black;text-decoration:none;}
A.ssmItems:hover {color:black;text-decoration:none;}
A.ssmItems:active {color:black;text-decoration:none;}
A.ssmItems:visited {color:black;text-decoration:none;}
//-->
</style>
</head>
<body>
<?php
include 'include/connect.php';
session_start();
if(!isset($_SESSION['email']))
{
echo "<script> alert('Login First!!');</script>";
echo "<script> window.location='index.php'</script>";
}
else
{
$c=$_SESSION['email'];
?>
<div class="wrapper col1">
<div id="header">
<div id="logo">
<h1><a href="#">SPAM</a></h1>
<p>Student Project Allocation Management</p>
</div>
<div class="fl_right">
<h2>Welcome <?php echo $c ;?></h2>
<ul>
<li class="last"><a href="#">Search</a></li>
<li><a href="www.google.com">Online Support</a></li>
<li><a href="www.ecajmer.ac.in">College Board</a></li>
</ul>
<p>Tel: +91-0145-267 1800 |</p><p> Mail: [email protected]</p>
</div>
<br class="clear" />
</div>
</div>
<!-- ####################################################################################################### -->
<div class="wrapper col2" style="padding-left:175px; width:auto;">
<div id="cssmenu">
<ul>
</li>
<li class="has-sub"><a href="#">Co-ordinator List</a>
<ul>
<li><a href="co-it.php">Information Technology</a></li>
<li><a href="co-cs.php">Computer Science</a></li>
<li><a href="co-ec.php">Electronics & communication</a></li>
<li><a href="co-eic.php">EIC</a></li>
<li><a href="co-e.php">Electrical</a></li>
<li><a href="co-m.php">mechanical</a></li>
</ul>
</li>
<li class="has-sub"><a href="#">Guide List</a>
<ul>
<li><a href="gu-it.php">Information Technology</a></li>
<li><a href="gu-cs.php">Computer Science</a></li>
<li><a href="gu-ec.php">Electronics & communication</a></li>
<li><a href="gu-eic.php">EIC</a></li>
<li><a href="gu-e.php">Electrical</a></li>
<li><a href="gu-m.php">mechanical</a></li>
</ul>
</li>
<li class="has-sub"><a href="#">Student List</a>
<ul>
<li><a href="st-it.php">Information Technology</a></li>
<li><a href="st-cs.php">Computer Science</a></li>
<li><a href="st-ec.php">Electronics & communication</a></li>
<li><a href="st-eic.php">EIC</a></li>
<li><a href="st-e.php">Electrical</a></li>
<li><a href="st-m.php">mechanical</a></li> </ul></li>
<li class="has-sub"><a href="#">Projects</a>
<ul>
<li><a href="cs.php">Computer Science</a></li>
<li><a href="eee.php">Electrical</a></li>
<li><a href="ec.php">Electronics & Communication</a></li>
<li><a href="eic.php">EIC</a></li>
<li><a href="it.php">Information Technology</a></li>
<li><a href="mech.php">Mechanical</a></li>
<li><a href="civil.php">Civil</a></li>
</ul>
</li>
<li class="last"><a href="logout.php">Logout</a></li>
</ul>
</div>
</div>
<div id="c">
<div id="inner">
<form method="POST">
<table>
<tr><td>
Old Password:
</td>
<td>
<input type="password" name="oldpassword" style="width:300px; height:40px;" required><br>
</td>
</tr>
<br /><tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr>
<td>
New Password:
</td>
<td>
<input type="password" name="newpassword" style="width:300px; height:40px;" required><br>
</td></tr>
<br /><tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr>
<td>
Confirm Password:
</td><td>
<input type="password" name="confirmpassword" style="width:300px; height:40px;" required><br></td></tr>
<br /><br />
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr>
<td></td>
<td>
<center><input type="submit" name="change_password" value="change password" style="width:150px; height:30px;"></center>
</td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
</form>
<?php
error_reporting(0);
$oldpassword=$_POST['oldpassword'];
$newpassword=$_POST['newpassword'];
$confirmpassword=$_POST['confirmpassword'];
if($_POST['change_password'])
{
$query="select password from spam_sign_in where email='$c' and category='guide'";
$res=mysql_query($query);
$data=mysql_fetch_array($res);
$oldpass=$data['password'];
if($oldpassword==$oldpass)
{
if($newpassword==$confirmpassword)
{
$up="update spam_sign_in set password='$newpassword' where password='$oldpassword' and category='guide'";
mysql_query($up);
echo "<script>alert('Password has been changed');</script>";
echo "<script>window.location='index.php';</script>";
}
else
{
echo "<script>alert('does not match/incorrect')</script>";
}
}
else
{
echo "<script>alert('old password does not match')</script>";
}
}
}
?>
</div>
</div>
</body>
</html>