-
Notifications
You must be signed in to change notification settings - Fork 0
/
forgotten-password.php
82 lines (72 loc) · 2.63 KB
/
forgotten-password.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
<?php
session_start();
if(isset($_SESSION['id'])){
header("location: dashboard.php");
}
require "includes/login-header.php"; ?>include
<body>
<section class="container-fluid login-wrapper pt-3">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-6">
<div class="login-form">
<a href="index.php" class="logo d-flex align-items-center">
<!-- Uncomment the line below if you also wish to use an image logo -->
<img src="assets/img/easylearn/logo-cut.png" style="border-radius: 5px; width: 4rem; height: 4rem; margin-left: 8.5rem;" alt="">
</a>
<h2 class="pt-5" style="font-size: 2rem; text-align: center;">Forgotten Password </h2>
<form id="registration_form">
<div class="form-group mb-3">
<div style="color: white;" id="message">
</div>
</div>
<div class="input-group mb-5">
<input type="email" class="form-control" id="email" placeholder="Enter Email Address*">
</div>
<div class="form-group">
<button type="submit" id="register_btn" class="form-control getStarted-btn">Continue</button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<?php require "includes/login-footer.php"; ?>
<script>
$(document).on('click', '#register_btn', function(e){
e.preventDefault();
var email = $('#email').val();
var btn = $('#register_btn').val();
if(email == ""){
Swal.fire(
'Invalid',
'No field should be empty',
'error'
)
} else{
$.ajax({
url: 'backend/forgotten-password.php',
type: 'post',
data:
{
email: email,
btn:btn
},
success: function(response){
$('#message').html(response);
if(response == "yes"){
location.href = "v-email.php";
} else {
Swal.fire(
'Invalid',
'Email Does not Exists',
'error'
)
}
}
});
$('#registration_form')[0].reset();
}
});
</script>