-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathotpVerify.php
151 lines (120 loc) · 3.17 KB
/
otpVerify.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
<?php
session_start();
include 'header.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}
* {
box-sizing: border-box;
}
/* style the container */
.container {
width: 30%;
position: relative;
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px 0 30px 0;
}
/* style inputs and link buttons */
input,
.btn {
width: 80%;
padding: 12px;
border: none;
border-radius: 4px;
margin: 5px 0;
opacity: 0.85;
display: inline-block;
font-size: 17px;
line-height: 20px;
text-decoration: none; /* remove underline from anchors */
}
input:hover,
.btn:hover {
opacity: 1;
}
/* style the submit button */
input[type=submit] {
background-color: #4CAF50;
color: white;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
.jumbotron1 {
padding-left: 60px;
}
/* hide some text on medium and large screens */
.hide-md-lg {
display: none;
}
/* Responsive layout - when the screen is less than 650px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 650px) {
.col {
width: 100%;
margin-top: 0;
}
/* hide the vertical line */
.vl {
display: none;
}
/* show the hidden text on small screens */
.hide-md-lg {
display: block;
text-align: center;
}
}
</style>
</head>
<body>
<br><br><br>
<div class="container">
<h2 style="text-align:center">OTP VERIFY</h2>
<div class="hide-md-lg">
<p>OTP VERIFY</p>
</div>
<div class="jumbotron1">
<form method="post" action="otpVerify.php" id="form">
<!--<input type="mail" name="mail" placeholder="Email" required>-->
<input type="number" name="otp" placeholder="OTP" required>
<input type="submit" value="Verify" name="verify">
</form>
</div>
</div>
</body>
</html>
<?php
include 'db.php';
$pDatabase= Database::getInstance();
if (isset($_POST['verify']))
{
$email=$_SESSION['mailid'];//$_POST['mail'];
$otp=$_POST['otp'];
if($_SESSION['user']=='renter')
{
$sel="SELECT * FROM `verification_renter` WHERE email='$email' and OTP='$otp'";
$p=$pDatabase->query($sel);
$upd="UPDATE `verification_renter` SET `flag`='1' WHERE email='$email'";
$p1=$pDatabase->query($upd);
echo'<script> window.location="profile_renter/profile_renter.php";
alert("Account activated !!"); </script>';
}
else if($_SESSION['user']=='buyer')
{
$sel="SELECT * FROM `verification_buyer` WHERE email='$email' and OTP='$otp'";
$p=$pDatabase->query($sel);
$upd="UPDATE `verification_buyer` SET `flag`='1' WHERE email='$email'";
$p1=$pDatabase->query($upd);
echo'<script> window.location="profile_buyer/profile_buyer.php";
alert("Account activated !!"); </script>';
}
}
?>