-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset.php
197 lines (137 loc) · 6.05 KB
/
reset.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
<?php
session_start();
ob_start();
if(isset($_SESSION['fname'])&&isset($_SESSION['reg_id']))
{
header('location:logged.php');
}
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Password Reset</title>
<link rel="icon" href="img/favicon.png">
<link rel="stylesheet" href="css/components.css">
<link rel="stylesheet" href="css/icons.css">
<link rel="stylesheet" href="css/responsee.css">
<link rel="stylesheet" href="owl-carousel/owl.carousel.css">
<link rel="stylesheet" href="owl-carousel/owl.theme.css">
<link rel="stylesheet" href="css/lightcase.css">
<!-- CUSTOM STYLE -->
<link rel="stylesheet" href="css/template-style.css">
<link href="https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,700,900&subset=latin-ext" rel="stylesheet">
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
</head>
<body class="size-1280">
<!-- PREMIUM FEATURES BUTTON -->
<a target="_blank" class="hide-s" href="../template/virtua-premium-responsive-business-template/" style="position:fixed;top:120px;right:-14px;z-index:10;"><img src="img/premium-features.png" alt=""></a>
<!-- HEADER -->
<?php
include('header.php');
?>
<!-- MAIN -->
<main role="main">
<article>
<!-- Header -->
<header class="section background-image text-center" style="background-image:url(img/img-05.jpg)">
<h1 class="animated-element slow text-extra-thin text-white text-s-size-30 text-m-size-40 text-size-50 text-line-height-1 margin-bottom-30 margin-top-130">
Reset Password
</h1>
<!-- white full width arrow object -->
<img class="arrow-object" src="img/arrow-object-white.svg" alt="">
</header>
<!-- Section 1 -->
<section class="section-small-padding background-white text-center">
<div class="line">
<i class="icon-lock text-primary text-size-40"></i>
</div>
</section>
<!-- Section 3 -->
<section class="section background-dark">
<div class="s-12 m-12 l-4 center">
<h3 class="text-size-30 margin-bottom-40 text-center"><b></b></h3>
<form class="customform text-white" method="post" action="reset.php" enctype="multipart/form-data">
<div class="line">
<div class="s-12">
<input name="phone" placeholder="Enter Registered Mobile Number" title="Your Mobile Number" type="number" required />
</div>
<div class="s-12">
<?php
if(isset($_POST['otp']))
{
require('connect.php');
$phone=$_POST['phone'];
$verify = "select * from userdata where phone='$phone'";
$exec=$conn->query($verify);
if($exec->num_rows>0)
{
$otp=mt_rand(100000,999999);
$_SESSION['otp']=$otp;
$_SESSION['mob']=$phone;
$msg="Your%20OTP%20is%20".$otp;
$url="http://203.129.203.243/blank/sms/user/urlsms.php?username=kietgzb&pass=kiet@123&senderid=KIETGZ&dest_mobileno=$phone&message=$msg&response=Y";
$c=curl_init();
curl_setopt($c,CURLOPT_RETURNTRANSFER,1);
curl_setopt($c,CURLOPT_URL,$url);
$contents=curl_exec($c);
curl_close($c);
date_default_timezone_set('Asia/Kolkata');
$date=date("Y-M-d");
$time = date('h:i:s a', time());
$insert="Insert into otp values('','$phone','$otp','$date','$time')";
$result=$conn->query($insert);
$conn->close();
echo '<p style="color:red; font-size:16px; background-color:green; text-align:center;">OTP Sent Successfully</p><br>';
ob_end_flush();
}
else
{
$conn->close();
echo '<p style="color:red; font-size:16px; background-color:red; text-align:center;">Incorrect Mobile Number</p><br>';
}
}
?>
</div>
<div class="s-12"><button class="button border-radius background-primary" name="otp" type="submit">Get OTP</button></div>
</form>
<div class="line">
<div class="margin">
<div class="s-12 m-12 l-6">
</div>
</div>
</div>
<form class="customform text-white" method="post" action="reset.php" enctype="multipart/form-data">
<div class="s-12">
<input name="otp_ver" placeholder="Enter OTP" title="OTP" type="number" required />
</div>
<div class="s-12">
<?php
if(isset($_POST['verify']))
{
if($_SESSION['otp']==$_POST['otp_ver'])
{
$_SESSION['verify']=true;
header('location:reset_pass.php');
ob_end_flush();
}
else
{
echo '<p style="color:red; font-size:16px; background-color:red; text-align:center;">Invalid OTP</p><br>';
}
}
?>
</div>
<div class="s-12"><button class="button border-radius background-primary" name="verify" type="submit">Verify</button></div>
</div>
</form>
</div>
</section>
</article>
</main>
<?php
include('footer.php');
?>