-
Notifications
You must be signed in to change notification settings - Fork 0
/
forgot_pass - Copy.php
executable file
·224 lines (141 loc) · 5.01 KB
/
forgot_pass - Copy.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
<!DOCTYPE>
<?php
session_start();
include("functions/functions.php");
?>
<html>
<head>
<title>MY online store</title>
<link rel="stylesheet" href="style.css" media="all">
</head>
<body>
<!--main wrapper starts-->
<div class="main_wrapper">
<!--header wrapper starts-->
<div class="header_wrapper">
<img id="logo" src="images\logo.png">
<img id="banner" src="images\banner2.jpg">
</div>
<!--header wrapper ends-->
<!--menubar starts-->
<div class="menubar">
<ul id="menu">
<li><a href="index.php">Home</a><li>
<li><a href="allproducts.php">All Products</a><li>
<li><a href="#">My Account</a><li>
<li><a href="register.php">Sign Up</a><li>
<li><a href="cart.php">Shopping Cart</a><li>
<li><a href="contact_us.php">Contact Us</a><li>
</ul>
<div id="form">
<form method="get" action="results.php" enctype="multipart/form-data">
<input id="text" type="text" placeholder="search item" name="user_query">
<input id="search" type="submit" value="Search" name="search">
</form>
</div>
</div>
<!--menubar ends-->
<!--content wrapper starts-->
<div class="content_wrapper">
<div id="sidebar">
<div id="sidebar-title">CATEGORIES</div>
<ul id="cats">
<?php getcats(); ?>
</ul>
<div id="sidebar-title">BRANDS</div>
<ul id="cats">
<?php getauthor(); ?>
</ul>
</div>
<div id="content_area">
<?php get_cart(); ?>
<div id="shopping_cart">
<span style="float:right;font-size:18px;padding:5px;line-height:35px;">
<?php
if(isset($_SESSION['customer_email']))
{
echo "<b style='color:darkturquoise;font-size:26px'>Welcome:-</b>"." ".$_SESSION['customer_email'];
}
else{
echo "<b>Welcome Guest!!</b>";
}
?>
<b style="color:yellow">Shopping Cart- </b>Total Items:<?php total_items(); ?> Total Price: <?php total_price(); ?> <a href="cart.php" style="color:red;text-decoration:none">Go to Cart</a>
<?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php' style='color:orange;'>Login</a>";
}
else{
echo "<a href='logout.php' style='color:orange;'>Logout</a>";
}
?>
</span>
</div>+---
<div id='products_box'>
<?php
include("includes/db.php");
//include("functions/functions.php");
?>
<div>
<form method="post">
<table bgcolor="skyblue" width="500" height="100" align="center">
<tr align="center">
<td colspan="4"><h2>FORGOT PASSWORD!!!</h2></td>
</tr>
<tr >
<td align="right" style="padding:19px">EMAIL:</td>
<td ><input type="email" name="email" placeholder="enter your email" required></td><br>
</tr><br>
<tr >
<td align="right" style="padding:19px">PASSWORD:</td>
<td><input type="password" name="password1" placeholder="enter your password" required></td>
</tr>
<tr >
<td align="right" style="padding:19px">CONFIRM PASSWORD:</td>
<td><input type="password" name="password2" placeholder="re-enter your password" required></td>
</tr>
<tr >
<td align="center" colspan="2" style="padding:19px" ><input type="submit" value="submit" name="submit">
</td>
</tr>
</table>
<h2 ><a href="register.php" style="float:right;text-decoration:none;padding:5px">New?Register Here!!</a></h2>
</form>
</div>
<?php
if(isset($_POST['submit'])){
$c_email = $_POST['email'];
$c_pass1 = $_POST['password1'];
$c_pass2 = $_POST['password2'];
$sel_email = "select * from customer where customer_email = '$c_email' ";
$sel_run = mysqli_query($con,$sel_email);
$sel_num = mysqli_num_rows($sel_run);
if($sel_num > 0){
if($c_pass1 == $c_pass2){
$change_pass = "update customer
set customer_pass = '$c_pass1'
where customer_email = '$c_email' ";
$change_run = mysqli_query($con,$change_pass);
echo "<script>alert('passoword successfully changed!!!');</script>";
echo "<script>window.open('checkout.php','_self')</script>";
}
else{
echo "<script>alert('forgot passowrd and Confirm password must be same!!');</script>";
}
}
else{
echo "<script>alert('Enter a valid email address!!');</script>";
}
}
?>
</div>
</div>
</div>
<!--content wrapper ends-->
<div id="footer">
<h2>©2014 by www.shopnix.com</h2>
</div>
</div>
<!--main wrapper ends-->
</body>
</html>