-
Notifications
You must be signed in to change notification settings - Fork 0
/
logverification.php
157 lines (129 loc) · 4.4 KB
/
logverification.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
<?php session_start() ?>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Fonts -->
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="style.css">
<link rel="icon" href="Favicon.png">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<title>Verification</title>
<style>
.notification {
padding: 15px;
color: white;
font-weight: bold;
border-radius: 5px;
margin-bottom: 10px;
position: fixed;
top: 20px;
right: 20px;
z-index: 9999;
}
/* Unique theme color */
:root {
--theme-color: #00c06e;
}
/* Navbar style */
.navbar-laravel {
background-color: var(--theme-color);
}
.navbar-laravel .navbar-brand {
color: #fff;
}
/* Form style */
.login-form {
margin-top: 50px;
}
.card-header {
background-color: var(--theme-color);
color: #fff;
}
.card-body {
background-color: #f8f9fa;
}
/* Button style */
input[type="submit"] {
background-color: var(--theme-color);
color: #fff;
border: none;
padding: 8px 20px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #00a25e;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light navbar-laravel">
<div class="container">
<a class="navbar-brand" href="#">Verification Account</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
<main class="login-form">
<div class="cotainer">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Verification Account</div>
<div class="card-body">
<form action="#" method="POST">
<div class="form-group row">
<label for="email_address" class="col-md-4 col-form-label text-md-right">OTP Code</label>
<div class="col-md-6">
<input type="text" id="otp" class="form-control" name="otp_code" required autofocus>
</div>
</div>
<div class="col-md-6 offset-md-4">
<input type="submit" value="Verify" name="verify">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
</body>
</html>
<?php
include('config.php');
// Function to display the notification message
function displayNotification($message, $theme) {
echo '<div class="notification" style="background-color: ' . $theme . '">';
echo $message;
echo '</div>';
}
if(isset($_POST["verify"])){
$otp = $_SESSION['otp'];
$email = $_SESSION['mail'];
$otp_code = $_POST['otp_code'];
if($otp != $otp_code){
// Display error notification
$errorMessage = "Invalid OTP code";
$themeColor = "red";
displayNotification($errorMessage, $themeColor);
}
else{
?>
<script>
window.location.replace("welcome.php");
</script>
<?php
}
}
?>