-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsms.php
More file actions
96 lines (95 loc) · 2.65 KB
/
sms.php
File metadata and controls
96 lines (95 loc) · 2.65 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PHP OTP Login Form</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
.login-form {
width: 340px;
margin: 50px auto;
}
.login-form form {
margin-bottom: 15px;
background: #f7f7f7;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
padding: 30px;
}
.login-form h2 {
margin: 0 0 15px;
}
.form-control, .btn {
min-height: 38px;
border-radius: 2px;
}
.btn {
font-size: 15px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="login-form">
<form method="post">
<h2 class="text-center">Log in</h2>
<div class="form-group first_box">
<input type="text" id="email" class="form-control" placeholder="Email" required="required">
<span id="email_error" class="field_error"></span>
</div>
<div class="form-group first_box">
<button type="button" class="btn btn-primary btn-block" onclick="send_otp()">Send OTP</button>
</div>
<div class="form-group second_box">
<input type="text" id="otp" class="form-control" placeholder="OTP" required="required">
<span id="otp_error" class="field_error"></span>
</div>
<div class="form-group second_box">
<button type="button" class="btn btn-primary btn-block" onclick="submit_otp()">Submit OTP</button>
</div>
</form>
</div>
<script>
function send_otp(){
var email=jQuery('#email').val();
jQuery.ajax({
url:'send_otp.php',
type:'post',
data:'email='+email,
success:function(result){
if(result=='yes'){
jQuery('.second_box').show();
jQuery('.first_box').hide();
}
if(result=='not_exist'){
jQuery('#email_error').html('Please enter valid email');
}
}
});
}
function submit_otp(){
var otp=jQuery('#otp').val();
jQuery.ajax({
url:'check_otp.php',
type:'post',
data:'otp='+otp,
success:function(result){
if(result=='yes'){
window.location='vault.php';
}
if(result=='not_exist'){
jQuery('#otp_error').html('Please enter valid otp');
}
}
});
}
</script>
<style>
.second_box{display:none;}
.field_error{color:red;}
</style>
</body>
</html>