-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkotp.php
36 lines (30 loc) · 1.14 KB
/
checkotp.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
<?php
session_start();
$otp=$_POST['otp'];
include 'connection.php';
$sql = "select * from new_reg where otp='$otp'";
//echo $sql;
$_SESSION['lotp']=$otp;
$result = mysqli_query($connection, $sql) or die("Error in Selecting " . mysqli_error($connection));
if(mysqli_affected_rows($connection)==0)
{
$_SESSION['otp']='Already used OTP, please try registering again from www.explora.in';
echo '<script type="text/javascript"> alert("Invalid or Already used OTP, please try registering again from www.explora.in")</script>';
echo "<script type='text/javascript'>window.location='otp.php'</script>";
}
while($row=mysqli_fetch_array($result))
{
if($row['flag']==0)
{
$_SESSION['otpl']='1';
echo "<script type='text/javascript'>window.location='newreg.php'</script>";
break;
}
else
{
$_SESSION['otp']='Already used OTP, please try registering again from www.explora.in';
echo '<script type="text/javascript"> alert("Invalid or Already used OTP, please try registering again from www.explora.in")</script>';
echo "<script type='text/javascript'>window.location='otp.php'</script>";
}
}
?>