-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathotp.php
353 lines (282 loc) · 10.1 KB
/
otp.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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<?php
session_start();
$name=$_POST['F_name'];
include 'header.php';
$otpn=rand(100000,999999);
$pass=$_POST['password'];
$res1 = $pro->findOne(array('Customer.U_name' =>$_POST['U_name'])); //check for availability of user name
if($res1){
echo "<script type='text/javascript'>alert('Given User Name is Not Available ..Enter Unique User Name'); window.location.href='register.php';</script>";
}
if($_SESSION['otp']==0)
{
$_SESSION['otp']=$otpn;
include('func.php');
error_reporting(0);
set_time_limit(0);
$ser="http://site24.way2sms.com/";
$ckfile = tempnam ("/tmp", "CURLCOOKIE");
$login=$ser."Login1.action";
// * Reciving Username of Way2sms A/c from Html form //
$uid="9423331650";
// * Reciving Password of Way2sms A/c from Html form //
$pwd="piyush";
// * To whome the message send to //
$to=$_POST['M_Number'];
// * Message to be sended //
$msg="Welcome to Water Corp.Your OTP (One Time Password) for registration is ".$_SESSION['otp'];
if(!$to)
{ $to=$uid; }
if(!$msg)
{ $msg=rword(5).rword(5).rword(5).rword(5).rword(5); }
$captcha=input($_REQUEST['captcha']);
flush();
if($uid && $pwd)
{
$ibal="0";
$sbal="0";
$lhtml="0";
$shtml="0";
$khtml="0";
$qhtml="0";
$fhtml="0";
$te="0";
flush();
$loginpost="gval=&username=".$uid."&password=".$pwd."&Login=Login";
$ch = curl_init();
$lhtml=post($login,$loginpost,$ch,$ckfile);
////curl_close($ch);
if(stristr($lhtml,'Location: '.$ser.'vem.action') || stristr($lhtml,'Location: '.$ser.'MainView.action') || stristr($lhtml,'Location: '.$ser.'ebrdg.action'))
{
preg_match("/~(.*?);/i",$lhtml,$id);
$id=$id['1'];
if(!$id)
{
goto end;
}
// * Login Sucess Message//
goto bal;
}
elseif(stristr($lhtml,'Location: http://site2.way2sms.com/entry'))
{
goto end;
}
else
{
// * Login Faild or SMS Send Error Message 2//
goto end;
}
bal:
///$ch = curl_init();
$msg=urlencode($msg);
$main=$ser."smstoss.action";
$ref=$ser."sendSMS?Token=".$id;
$conf=$ser."smscofirm.action?SentMessage=".$msg."&Token=".$id."&status=0";
$post="ssaction=ss&Token=".$id."&mobile=".$to."&message=".$msg."&Send=Send Sms&msgLen=".strlen($msg);
$mhtml=post($main,$post,$ch,$ckfile,$proxy,$ref);
curl_close($ch);
end:
flush();
}
}
?>
<!-- content -->
<div class="container">
<div class="main">
<!-- start registration -->
<div class="registration">
<div class="registration_left">
<h2>new Customer? <span> create an account </span></h2>
<!-- [if IE]
< link rel='stylesheet' type='text/css' href='ie.css'/>
[endif] -->
<!-- [if lt IE 7]>
< link rel='stylesheet' type='text/css' href='ie6.css'/>
<! [endif] -->
<script>
(function() {
// Create input element for testing
var inputs = document.createElement('input');
// Create the supports object
var supports = {};
supports.autofocus = 'autofocus' in inputs;
supports.required = 'required' in inputs;
supports.placeholder = 'placeholder' in inputs;
// Fallback for autofocus attribute
if(!supports.autofocus) {
}
// Fallback for required attribute
if(!supports.required) {
}
// Fallback for placeholder attribute
if(!supports.placeholder) {
}
// Change text inside send button on submit
var send = document.getElementById('register-submit');
if(send) {
send.onclick = function () {
this.innerHTML = '...Sending';
}
}
})();
</script>
<div class="registration_form">
<!-- Form -->
<form id="registration_form" action="otp.php" method="POST">
<div>
<label>
<input placeholder="first name:" name="F_name" type="text" tabindex="1" required autofocus value="<?php echo $name ?>" >
</label>
</div>
<div>
<label>
<input placeholder="last name:" name="L_name" type="text" tabindex="2" required autofocus value="<?php echo $_POST['L_name']?>">
</label>
</div>
<div>
<label>
<input placeholder="Mobile Number:" name="M_Number" type="tel" maxlength="10" tabindex="3" required value="<?php echo $_POST['M_Number']?>">
</label>
</div>
<div>
<label>
<input placeholder="email address:" name="email" type="email" tabindex="4" required value="<?php echo $_POST['email']?>">
</label>
</div>
<div>
<label>
<input placeholder ="Address" name="address" rows="2" cols="55" tabindex="5" value="<?php echo $_POST['address']?>"></input>
</label>
</div>
<div id="frmCheckUsername">
<label>
<input placeholder="Choose Unique User_Name " name="U_name" type="text" tabindex="6" id="U_name" class="demoInputBox" onBlur="checkAvailability()" required value="<?php echo $_POST['U_name']?>"><span id="user-availability-status"></span> </label>
</div>
<div>
<label>
<input placeholder="password" name="password" type="password" tabindex="7" required value="<?php echo $_POST['password']?>">
</label>
</div>
<div>
<label>
<input placeholder="retype password" name="re_password" type="password" tabindex="8" required value="<?php echo $_POST['re_password']?>">
</label>
</div>
<div>
<input type="submit" value="Become Customer" id="register-submit">
</div>
<div class="sky-form">
<label class="checkbox"><input type="checkbox" name="checkbox" checked><i></i>i agree to Water_Sys.com <a class="terms" href="#"> terms of service</a> </label>
</div>
</form>
<!-- /Form -->
</div>
</div>
<div class="registration_left">
<h2>existing Customer</h2>
<div class="registration_form">
<!-- Form -->
<form id="registration_form" action="LoginCheck.php" method="post">
<div>
<label>
<input placeholder="User Name" name="U_name" type="text" tabindex="10" required>
</label>
</div>
<div>
<label>
<input placeholder="password" name="password" type="password" tabindex="11" required>
</label>
</div>
<div>
<input type="submit" value="sign in" id="register-submit">
</div>
<div class="forget">
<a href="#">forgot your password</a>
</div>
</form>
<!-- /Form -->
</div>
</div>
<div class="clearfix"></div>
</div>
<!-- end registration -->
</div>
</div>
<?php
include 'footer.php'
?>
<script type="text/javascript">
function checkAvailability() {
//$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'U_name='+$("#U_name").val(),
type: "POST",
success:function(data){
$("#user-availability-status").html(data);
//$("#U_name").val("");
//$("#loaderIcon").hide();
},
error:function (){}
});
}
</script>
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog" position=absolute>
<!-- Modal content-->
<div class="modal-content">
<div class="bg-1">
<div class="modal-header">
<center><h1 class="modal-title fHead">Mobile Number OTP Verification. </h1></center>
</div>
<div class="modal-body">
<?php
echo "Enter the One Time password (OTP) sent to your mobile number.";
?>
<form method="post">
<input type="number" name="inc" value="">
<input type="submit" name="update" value="Submit">
<input name="password" type="password" hidden value="<?php echo $_POST['password']?>" />
<input name="F_name" type="text" hidden value="<?php echo $_POST['F_name']?>" />
<input name="L_name" type="text" hidden value="<?php echo $_POST['L_name']?>" />
<input name="M_Number" type="tel" maxlength="10" hidden value="<?php echo $_POST['M_Number']?>" />
<input name="email" type="email" hidden value="<?php echo $_POST['email']?>" />
<input name="address" hidden value="<?php echo $_POST['address']?>" />
<input name="U_name" hidden type="text" id="U_name" value="<?php echo $_POST['U_name']?>" />
<input type="submit" hidden value="Become Customer" id="register-submit" />
</form>
<form method="post" id="otpsuccess" action="Customer.php">
<input name="password" type="password" hidden value="<?php echo $_POST['password']?>" />
<input name="F_name" type="text" hidden value="<?php echo $_POST['F_name']?>" />
<input name="L_name" type="text" hidden value="<?php echo $_POST['L_name']?>" />
<input name="M_Number" type="tel" maxlength="10" hidden value="<?php echo $_POST['M_Number']?>" />
<input name="email" type="email" hidden value="<?php echo $_POST['email']?>" />
<input name="address" hidden value="<?php echo $_POST['address']?>" />
<input name="U_name" hidden type="text" id="U_name" value="<?php echo $_POST['U_name']?>" />
<input type="submit" hidden value="Become Customer" id="register-submit" />
</form>
<?php
if(isset($_POST["update"]))
{
//echo "Updatsdvds dfbz".$_POST['inc'];
if($_POST["inc"]==$_SESSION['otp'])
{
$_SESSION['otp']=0;
?> <script type='text/javascript'> document.getElementById("otpsuccess").submit();</script> <?php
}
else
{
echo "Invalid.Enter Again.";
}
}
?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="window.location.href='register.php';">Close</button>
</div>
</div>
</div>
</div>
</div>
</body>
</html>