-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset.php
101 lines (68 loc) · 2.53 KB
/
reset.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
<?php
include('connect.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Online Attendance Management System 1.0</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/main.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" >
<link rel="stylesheet" href="styles.css" >
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<header>
<h1>Online Attendance Management System 1.0</h1>
<div class="navbar">
<a href="index.php">Login</a>
</div>
</header>
<center>
<div class="content">
<div class="row">
<form method="post" class="form-horizontal col-md-6 col-md-offset-3">
<h3>Recover your password</h3>
<div class="form-group">
<label for="input1" class="col-sm-2 control-label">Email</label>
<div class="col-sm-10">
<input type="email" name="email" class="form-control" id="input1" placeholder="your email" />
</div>
</div>
<input type="submit" class="btn btn-primary col-md-2 col-md-offset-10" value="Go" name="reset" />
</form>
<br>
<?php
if(isset($_POST['reset'])){
$test = $_POST['email'];
$row = 0;
$query = mysql_query("select password from admininfo where email = '$test'");
$row = mysql_num_rows($query);
if($row == 0){
?>
<div class="content"><p>Email is not associated with any account. Contact OAMS 1.0</p></div>
<?php
}
else{
$query = mysql_query("select password from admininfo where email = '$test'");
$i =0;
while($dat = mysql_fetch_array($query)){
$i++;
?>
<strong>
<p style="text-align: left;">Hi there!<br>You requested for a password recovery. You may <a href="index.php">Login here</a> and enter this key as your password to login. Recovery key: <mark><?php echo $dat['password']; ?></mark><br>Regards,<br>Online Attendance Management System 1.0</p></strong>
<?php
}
}
}
?>
</div>
</div>
</center>
</body>
</html>