-
Notifications
You must be signed in to change notification settings - Fork 30
/
validateOTPHandle.php
34 lines (34 loc) · 1.31 KB
/
validateOTPHandle.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
<?php
session_start();
include 'connect.php';
$infid = $_SESSION['infid'];
$correct_otp = $_SESSION['otp'];
if($_SESSION['forgot']=="active"){
if(isset($_POST['validate'])){
$user_otp = $_POST['user_otp'];
if($user_otp == $correct_otp)
{
echo '<div class="alert alert-success alert-dismissible show" role="alert" style="position:absolute; top:75px; width:100%;" >
<strong>Success!! OTP Validated.'.
'<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
</div>';
$_SESSION['infid'] = $infid;
$_SESSION['validOtp'] = "active";
header('location:updatePassword.php');
}
else{
//If wrong OTP entered
echo '<div class="alert alert-success alert-dismissible show" role="alert" style="position:absolute; top:75px; width:100%; color:red; background: #ff000020;" >
<strong>OTP you entered is wrong.</strong>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
</div>';
}
}
}else{
header('location:forgotPassword.php');
}
?>