-
Notifications
You must be signed in to change notification settings - Fork 0
/
recover.php
54 lines (50 loc) · 1.63 KB
/
recover.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
<?php
include 'core/init.php';
logged_in_redirect();
?>
<link href="css/bootstrap.css" rel="stylesheet">
<div class="page-header">
<h1>Recover</h1>
</div>
<?php
if(isset($_GET['success'])==true && empty($_GET['success'])=== true){
?>
<p>Thank! we emailed you</p>
<?php
}else{
$mode_allowed = array('username','password');
if(isset($_GET['mode']) == true && in_array($_GET['mode'], $mode_allowed)== true ){
if(isset($_POST['email'])==true && empty($_POST['email'])==false){
if(email_exists($_POST['email'])===true){
recover($_GET['mode'], $_POST['email']);
header('location:recover.php?success');
exit();
}else{
echo '<p>Email Does not Exist</p>';
}
}
?>
<form class="form-horizontal" action="" method="post">
<div class="form-group">
<label for="username" class="col-sm-2 control-label">Please enter your Email Address:</label>
<div class="col-sm-10">
<input type="email" class="form-control" name="email" placeholder="Username" required>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Recover</button>
</div>
</div>
</form>
<?php
}else{
header('location: index.php');
exit();
}
}
?>
<?php include 'includes/overall/overall_footer.php';?>
<script src="js/jquery-2.1.3.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>