-
Notifications
You must be signed in to change notification settings - Fork 0
/
change_pwd.php
283 lines (238 loc) · 8.6 KB
/
change_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
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<?php
require "connect.php";
if(!isset($_SESSION['email']) || empty($_SESSION['email'])){
header("Location:login.php");
}
$key=0;
if(isset($_POST['submit'])){
$email=$_SESSION['email'];
$query = "SELECT password FROM user WHERE emailid='$email'";
$query_run=mysql_query($query);
$row = mysql_fetch_array($query_run);
if($row['password']==md5($_POST['cpw'])){
$query_run = mysql_query($query) or die(mysql_error);
if($_POST['pw']==$_POST['rpw']){
$pwh=md5($_POST['pw']);
$query="UPDATE user SET password='$pwh' WHERE emailid='$email'";
$query_run = mysql_query($query) or die(mysql_error);
header("Location:edit_profile.php");
}
else
$key=1;
}
else
$key=2;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Sentir, Responsive admin and dashboard UI kits template">
<meta name="keywords" content="admin,bootstrap,template,responsive admin,dashboard template,web apps template">
<meta name="author" content="Ari Rusmanto, Isoh Design Studio, Warung Themes">
<title>Star Contests</title>
<!-- BOOTSTRAP CSS (REQUIRED ALL PAGE)-->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<!-- PLUGINS CSS-->
<link href="assets/plugins/magnific-popup/magnific-popup.css" rel="stylesheet">
<link href="assets/plugins/owl-carousel/owl.carousel.css" rel="stylesheet">
<link href="assets/plugins/owl-carousel/owl.theme.css" rel="stylesheet">
<link href="assets/plugins/owl-carousel/owl.transitions.css" rel="stylesheet">
<!-- MAIN CSS (REQUIRED ALL PAGE)-->
<link href="assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/css/style-responsive.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="tooltips">
<!--
===========================================================
BEGIN PAGE
===========================================================
-->
<!-- BEGIN TOP NAVBAR -->
<div class="top-navbar dark-color">
<div class="container">
<!-- Begin logo -->
<div class="logo">
<a href="home_page.php"><img src="Images/logo.png" alt="Logo"></a>
</div><!-- /.logo -->
<!-- End logo -->
<!-- Begin button toggle nav -->
<!-- End button toggle nav -->
<!-- Begin visible phone and search nav -->
<!-- End visible phone and search nav -->
<!-- Begin nav menu -->
<ul class="menus">
<li class="parent">
<a href="home_page.php">Home</a>
</li>
<li class="parent">
<a href="search_event.php">Browse Contests</a>
</li>
<li class="parent">
<a href="my_profile.php"><?php
$email=$_SESSION['email'];
$query = "SELECT * FROM `sen_08`.`user` WHERE `emailid`='$email' ";
$result=mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
echo "Hi, ";
echo $row['name'];
?></a>
<ul class="sub-menus">
<li class="sub-list"><a href="my_events.php">My Contests</a></li>
<li class="sub-list"><a href="edit_profile.php">Edit profile</a></li>
<li class="sub-list"><a href="logout.php">Logout</a></li>
</ul>
</li>
<!-- <li class="parent"><a href="contact.html">Contact Us</a></li> -->
<!-- Begin right icon -->
<!-- End right icon -->
</ul>
<!-- End nav menu -->
</div><!-- /.container -->
</div><!-- /.top-navbar -->
<!-- END TOP NAVBAR -->
<!-- BEGIN BERADCRUMB AND PAGE TITLE -->
<div class="page-title-wrap">
<div class="container">
<ol class="breadcrumb">
<li><a href="index.html">Home</a></li>
<li class="active">Contact</li>
</ol>
<h2 class="page-title">Change Password</h2>
<h4>
<?php if($key==1) echo "Passwords didnt match"; else if ($key==2) echo "Wrong currennt password.";;
?>
</h4>
</div><!-- /.container -->
<div class="border-bottom">
<div class="container">
<div class="border-bottom-color bg-info"></div>
</div><!-- /.container -->
</div><!-- /.border-bottom -->
</div><!-- /.page-title-wrap -->
<!-- END BERADCRUMB AND PAGE TITLE -->
<!-- BEGIN CONTACT SECTION -->
<div class="section">
<div class="container">
<div class="row">
<div class="col-sm-7">
<div class="contact-form-wrap">
<form role="form" action="change_pwd.php" method="post">
<div class="form-group">
<label>Current Password:</label>
<input type="password" name="cpw" class="form-control" required>
</div>
<div class="form-group">
<label>New password:</label>
<input type="password" name="pw" class="form-control" pattern=".{5,15}" required title="5 to 15 characters">
</div>
<div class="form-group">
<label>Repeat Password:</label>
<input type="password" name="rpw" class="form-control" pattern=".{5,15}" required title="5 to 15 characters">
</div>
<input type="submit" class="btn btn-success" name="submit" value="Save password" >
</form>
</div><!-- /.contact-form-wrap -->
</div><!-- /.col-sm-7 --></div></div></div>
<!-- BEGIN CALL TO ACTION -->
<footer>
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4">
<a href='about_us.php'><h4>ABOUT STAR CONTESTS</h4></a>
<p>
We are a software engineering team of 9 people at DA-IICT.
Our platform addresses different aspects of contest/tournament/event organizing
for organizers, participants, sub-organizers and volunteers. It is a platform for local talent and
local organizers.
</p>
</div><!-- /.col-sm-4 -->
<div class="col-sm-6 col-md-3">
<h4>CONTACT</h4>
<div class="media media-contact">
<span class="pull-left">
</span>
<div class="media-body">
<address>
Software Engineering Project Team 8<br>
DAIICT<br>
</address>
</div><!-- /.media-body -->
</div><!-- /.media -->
<div class="media media-contact">
<span class="pull-left">
</span>
<div class="media-body">
<address>
Star contests<br>
9898542584
</address>
</div><!-- /.media-body -->
</div><!-- /.media -->
</div><!-- /.col-sm-3 -->
</div><!-- /.row -->
</div><!-- /.container -->
</footer><!-- /.section -->
<div class="footer">
<div class="container">
<div class="row">
<div class="col-sm-5">
</div><!-- /.col-sm-5 -->
<div class="col-sm-7 text-right">
<ul class="list-inline">
</ul>
</div><!-- /.col-sm-7 -->
</div><!-- /.row -->
</div><!-- /.container -->
</div><!-- /.footer -->
<!-- END FOOTER -->
<!-- END BACK TO TOP -->
<!--
===========================================================
END PAGE
===========================================================
-->
<!--
===========================================================
Placed at the end of the document so the pages load faster
===========================================================
-->
<!-- MAIN JAVASRCIPT (REQUIRED ALL PAGE)-->
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/plugins/retina/retina.min.js"></script>
<script src="assets/plugins/backstretch/jquery.backstretch.min.js"></script>
<script src="assets/plugins/magnific-popup/jquery.magnific-popup.min.js"></script>
<script src="assets/plugins/owl-carousel/owl.carousel.min.js"></script>
<script src="assets/plugins/mixitup/jquery.mixitup.js"></script>
<script>
$(document).ready(function(){
$(function(){
var shrinkHeader = 250;
$(window).scroll(function() {
var scroll = getCurrentScroll();
if ( scroll >= shrinkHeader ) {
$('.top-navbar').addClass('shrink-nav');
}
else {
$('.top-navbar').removeClass('shrink-nav');
}
});
function getCurrentScroll() {
return window.pageYOffset || document.documentElement.scrollTop;
}
});
})
</script>
<script src="assets/js/apps.js"></script>
</body>
</html>