-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforgot-password.php
51 lines (49 loc) · 1.59 KB
/
forgot-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
<?php
$title = 'Forgot Password | SN';
include_once("classes/DB.php");
include_once("classes/Login.php");
include_once('assets/templates/header.php');
if(Login::isLoggedin()) {
die("Sorry! you're already loggedin.");
}
?>
<div class="login">
<h2>Forgot Password</h2>
<form action="<?= $_SERVER['PHP_SELF'] ?>" method="POST">
<div class="form-group">
<input type="text" class="form-control" name="email" placeholder="Type your Email"/>
</div>
<div class="form-group">
<input type="submit"class="btn btn-block btn-lg btn-sn" value="Reset Password" />
</div>
<div class="alert alert-success">We Send You an Email Successfully!</div>
</form>
</div>
<script>
$(function () {
"use strict";
var submit = $("input[type=submit]");
submit.click(function() {
var email = $("input[name=email]");
$.ajax({
url: "api/?forgotPassword_Email",
type: 'POST',
data: {
email : email.val()
},
success: function (data) {
submit.parent().next('.alert').fadeIn();
console.log(data);
},
error: function(data) {
submit.addClass('shake');
setTimeout(function() {
submit.removeClass('shake');
}, 600);
$('form').trigger('reset');
}
});
});
});
</script>
<?php include_once("assets/templates/footer.php"); ?>