-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathforgot.php
More file actions
106 lines (93 loc) · 3.63 KB
/
forgot.php
File metadata and controls
106 lines (93 loc) · 3.63 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
97
98
99
100
101
102
103
104
105
106
<?php
$gotAnswer = False;
$gotUser = False;
$isPost = False;
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$isPost = True;
if (strtoupper($_POST['user']) == "BRAD") $gotUser = True;
if ($_POST['question'] == "3")
if (str_replace(' ','',strtoupper($_POST['answer'])) == 'MRMUFFY') $gotAnswer = True;
}
?>
<!DOCTYPE html>
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Hacme Central</title>
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/custom.modernizr.js"></script>
</head>
<body>
<div class="row">
<div class="large-12 columns">
<h2>Foundstone's Hacme Central</h2>
<hr />
</div>
</div>
<?php if ($isPost == True && $gotAnswer == True) { ?>
<div class = "row">
<div class="large-6 large-centered columns">
<h2>Forgot Password</h2>
<p>Your password is: <font color="red">ILoveMyFluffyMrMuffy</font></p>
</div>
<div class="large-6 large-centered columns">
<p><a href="index.php">Return to login page</a></p>
</div>
</div>
<?php } else { ?>
<div class="row">
<div class="large-6 large-centered columns">
<h3>Forgot Password</h3>
<p><?php
if ($isPost == True && $gotUser == False)
echo "<label class=\"error\">Invalid username</label>";
else if ($isPost == True && $gotUser == True && $gotAnswer == False)
echo "<label class=\"error\">Sorry, what you provided didn't match what we have on file</label>";
else
echo "<label>Please specify a question and provide an answer</label>";
?></p>
<form action="forgot.php" method="POST">
<div class="row">
<div class="large-8 columns">
<input type="text" name="user" placeholder="Username">
</div>
</div>
<div class="row">
<div class="large-8 columns">
<label for="questionDropdown">Select the question</label>
<select id="questionDropdown" name="question" class="medium">
<option value="1">What is your mother's maiden name?</option>
<option value="2">What is your favorite teacher's name?</option>
<option value="3">What is your pet's name?</option>
<option value="4">What town did you grow up in?</option>
</select>
</div>
</div>
<div class="row">
<div class="large-8 columns">
<input type="text" name="answer" placeholder="Answer" >
</div>
</div>
<div class="row">
<div class="large-7 large-offset-1 columns">
<input type="submit" class="small button" value="Submit">
</div>
</div>
</form>
</div>
<?php } ?>
</div>
<script>
document.write('<script src=' +
('__proto__' in {} ? 'js/vendor/zepto' : 'js/vendor/jquery') +
'.js><\/script>')
</script>
<script src="js/foundation.min.js"></script>
<script src="js/foundation/foundation.forms.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>