-
Notifications
You must be signed in to change notification settings - Fork 9
/
user-otp.php
106 lines (101 loc) · 3.59 KB
/
user-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
<?php require_once "controllerUserData.php"; ?>
<?php
$email = $_SESSION['email'];
if($email == false){
header('Location: login-user.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Code Verification</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style-form.css">
<style>
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
#gif {
z-index: 0;
position: fixed;
right: 0;
bottom: 0;
min-width: 100%;
min-height: 100%;
opacity: .5;
z-index: -2;
}
.vr {
border: .5px solid rgba(0, 0, 0, .1);
height: 330px;
}
.row {
display: flex;
flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
justify-content: space-evenly;
align-items: center;
}
</style>
</head>
<body>
<img id="gif" src="./public/assets/43295-heart-fly-transparent-bg.gif" alt="" >
<div class="container">
<div class="row">
<div class="col-md-4 form">
<form action="user-otp.php" method="POST" autocomplete="off">
<h2 class="text-center">Code Verification</h2>
<?php
if(isset($_SESSION['info'])){
?>
<div class="alert alert-success text-center">
<?php echo $_SESSION['info']; ?>
</div>
<?php
}
?>
<?php
if(count($errors) > 0){
?>
<div class="alert alert-danger text-center">
<?php
foreach($errors as $showerror){
echo $showerror;
}
?>
</div>
<?php
}
?>
<div class="form-group">
<label for="otp" class="form-label">Verification Code</label>
<input class="form-control" id="otp" type="number" name="otp" placeholder="Enter verification code" required onkeyup="checkLength(this.value);">
</div>
<div class="form-group">
<input class="form-control button" type="submit" name="check" value="Submit">
</div>
</form>
</div>
<div class="vr"></div>
<img src="./public/assets/SoulMate (3).png" alt="logo" height="100">
</div>
</div>
<script>
let otp = document.getElementById("otp");
function checkLength(num) {
console.log(num.toString());
if(num.toString().length <= 0 || num.toString().length < 6 || num.toString().length > 6) {
otp.classList.add('is-invalid');
otp.classList.remove('is-valid');
} if(num.toString().length == 6) {
otp.classList.remove('is-invalid');
otp.classList.add('is-valid');
}
}
</script>
</body>
</html>