-
Notifications
You must be signed in to change notification settings - Fork 1
/
change_password.php
242 lines (233 loc) · 9.22 KB
/
change_password.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
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
if(isset($_POST['submit5']))
{
$password=md5($_POST['password']);
$newpassword=md5($_POST['newpassword']);
$email=$_SESSION['login'];
$sql ="SELECT Password FROM tblusers WHERE EmailId=:email and Password=:password";
$query= $dbh -> prepare($sql);
$query-> bindParam(':email', $email, PDO::PARAM_STR);
$query-> bindParam(':password', $password, PDO::PARAM_STR);
$query-> execute();
$results = $query -> fetchAll(PDO::FETCH_OBJ);
if($query -> rowCount() > 0)
{
$con="update tblusers set Password=:newpassword where EmailId=:email";
$chngpwd1 = $dbh->prepare($con);
$chngpwd1-> bindParam(':email', $email, PDO::PARAM_STR);
$chngpwd1-> bindParam(':newpassword', $newpassword, PDO::PARAM_STR);
$chngpwd1->execute();
$msg="Your Password succesfully changed";
}
else {
$error="Your current password is wrong";
}
}
?>
<!doctype html>
<html lang="en-gb" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>My Travel -My Memories</title>
<meta name="description" content="Traveller">
<meta name="author" content="WebThemez">
<link rel="stylesheet" href="css/bootstrap.min.css" />
<!-- <link href="assets/css/bootstrap.css" rel='stylesheet' type='text/css' /> -->
<link rel="stylesheet" type="text/css" href="css/isotope.css" media="screen" />
<link rel="stylesheet" href="js/fancybox/jquery.fancybox.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/da-slider.css" />
<!-- Owl Carousel Assets -->
<link href="js/owl-carousel/owl.carousel.css" rel="stylesheet">
<link rel="stylesheet" href="css/styles.css" />
<!-- Font Awesome -->
<!--animate-->
<link href="assets/css/animate.css" rel="stylesheet" type="text/css" media="all">
<link href="font/css/font-awesome.min.css" rel="stylesheet">
<script type="text/javascript">
function valid()
{
if(document.chngpwd.newpassword.value!= document.chngpwd.confirmpassword.value)
{
alert("New Password and Confirm Password Field do not match !!");
document.chngpwd.confirmpassword.focus();
return false;
}
return true;
}
</script>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<header class="header">
<?php if($_SESSION['login'])
{?>
<div class="top-header">
<div class="container">
<ul class="tp-hd-lft wow fadeInLeft animated" data-wow-delay=".5s">
<li class="hm"><a href="index.php"><i class="fa fa-home"></i></a></li>
<li class="prnt"><a href="profile.php">My Profile</a></li>
<li class="prnt"><a href="change_password.php"data-toggle="modal" data-target="#myModal4">Change Password</a></li>
<li class="prnt"><a href="tour_history.php">My Tour History</a></li>
</ul>
<ul class="tp-hd-rgt wow fadeInRight animated" data-wow-delay=".5s">
<li class="tol">Welcome :</li>
<li class="sig"><?php echo htmlentities($_SESSION['login']);?></li>
<li class="sigi"><a href="logout.php" >/ Logout</a></li>
</ul>
<div class="clearfix"></div>
</div>
</div>
<?php
} else
{
?>
<div class="top-header">
<div class="container">
<ul class="tp-hd-lft wow fadeInLeft animated" data-wow-delay=".5s">
<li class="hm"><a href="admin/index.php">Admin Login</a></li>
</ul>
<ul class="tp-hd-rgt wow fadeInRight animated" data-wow-delay=".5s">
<li class="tol">Toll Number : 123-4568790</li>
<li class="sig"><a href="#" data-toggle="modal" data-target="#myModal" >Sign Up</a></li>
<li class="sigi"><a href="#" data-toggle="modal" data-target="#myModal4" > Sign In</a></li>
</ul>
<div class="clearfix"></div>
</div>
</div>
<?php
}?>
<div class="container">
<nav class="navbar navbar-inverse" role="navigation">
<div class="navbar-header adeInDown animated animated" data-wow-delay=".5s" style="visibility: visible; animation-delay: 0.5s; animation-name: fadeInDown;">
<a href="#" class="navbar-brand scroll-top logo"><b>Traveller</b></a>
<button type="button" id="nav-toggle" class="navbar-toggle" data-toggle="collapse" data-target="#main-nav">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!--/.navbar-header-->
<div id="main-nav" class="collapse navbar-collapse adeInDown animated animated" data-wow-delay=".5s" style="visibility: visible; animation-delay: 0.5s; animation-name: fadeInDown;">
<ul class="nav navbar-nav" id="mainNav">
<li ><a href="index.php" class="scroll-link">Home</a></li>
<li><a href="index.php" class="scroll-link">About Us</a></li>
<li><a href="index.php" class="scroll-link">Packages</a></li>
<li><a href="index.php" class="scroll-link">Gallery</a></li>
<li><a href="index.php" class="scroll-link">Contact Us</a></li>
</ul>
</div>
<!--/.navbar-collapse-->
</nav>
<!--/.navbar-->
</div>
<!--/.container-->
</header>
<!--/.header-->
<div id="#top"></div>
<section id="home">
<div class="banner-container" style="height: 300px;">
<!-- <img src="images/banner-bg.jpg" alt="banner" /> -->
<div class="container banner-content">
<div id="da-slider" class="da-slider">
<div> </div>
<div class="">
<h2>My Travel</h2>
<p>Get your plans right away.. enjoy!!!</p>
<div class="da-img"></div>
</div>
</div>
</div>
</div>
</section>
<!--Package-->
<section id="packages" class="secPad">
<div class="container">
<div class="heading text-center">
<!-- Heading -->
<h2>Change Password</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit</p>
</div>
<div class="privacy">
<div class="container">
<h3 class="wow fadeInDown animated animated" data-wow-delay=".5s" style="visibility: visible; animation-delay: 0.5s; animation-name: fadeInDown;">Change Password</h3>
<form name="chngpwd" method="post" onSubmit="return valid();">
<?php
if($error)
{
?>
<div class="errorWrap"><strong>ERROR</strong>:<?php echo htmlentities($error); ?> </div>
<?php
} else if($msg)
{?>
<div class="succWrap"><strong>SUCCESS</strong>:<?php echo htmlentities($msg); ?> </div>
<?php
}?>
<p style="width: 350px;">
<b>Current Password</b> <input type="password" name="password" class="form-control" id="exampleInputPassword1" placeholder="Current Password" required="">
</p>
<p style="width: 350px;">
<b>New Password</b>
<input type="password" class="form-control" name="newpassword" id="newpassword" placeholder="New Password" required="">
</p>
<p style="width: 350px;">
<b>Confirm Password</b>
<input type="password" class="form-control" name="confirmpassword" id="confirmpassword" placeholder="Confrim Password" required="">
</p>
<p style="width: 350px;">
<button type="submit" name="submit5" class="btn-primary btn">Change</button>
</p>
</form>
</div>
</div>
</div>
</div>
</section>
<?php include('includes/footer.php') ?>
<!-- signup -->
<?php include('includes/signup.php');?>
<!-- //signu -->
<!-- signin -->
<?php include('includes/signin.php');?>
<!-- //signin -->
<a href="#top" class="topHome"><i class="fa fa-chevron-up fa-2x"></i></a>
<script src="js/modernizr-latest.js"></script>
<script src="js/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/jquery.isotope.min.js" type="text/javascript"></script>
<script src="js/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>
<script src="js/jquery.nav.js" type="text/javascript"></script>
<script src="js/jquery.cslider.js" type="text/javascript"></script>
<script src="contact/contact_me.js"></script>
<script src="js/custom.js" type="text/javascript"></script>
<script src="js/owl-carousel/owl.carousel.js"></script>
</body>
</html>
<?php
} ?>