-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathverify_acct.php
executable file
·89 lines (67 loc) · 2.26 KB
/
verify_acct.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
<?php
include_once('include/unauthorize.php');
include_once("class.login.php");
$log = new logmein();
$log->encrypt = true; //set encryption
//$a = $log->passwordreset($_POST['email'],"logon","password","email");
if($_POST['type']=='email')
{
$result=$log->passwordreset($_POST['email'],"student","password","email");
if ($result== 1)
{
header("location: login.php?retry=1");
}
elseif ($result== 2)
{
header("location: login.php?invalid=1");
}
else
{
header("location: login.php?xyz=1");
}
}
else
{
include("include/header.php");
?>
<h3>Interactive Environmental Education Portal</h3>
</div>
<div class="row">
<div style="text-align:center" class="span12">
<div class="row">
<div class="span6 offset3">
<form class="well form-search" method="post" action="acct_verifier.php" name="login">
<legend>Security Question 1:</legend>
<?php
$username=$_POST['username'];
//echo $username;
$result=$log->qry("SELECT * FROM student WHERE username='?'",$username);
//echo $result;
$row=mysql_fetch_assoc($result);
if(!$row)
{
header("location: reset_password.php?err=1");
}
else
{
$q1=$row['q1'];
$q2=$row['q2'];
}
echo "<h4>".$q1."</h4>";
echo "<input type='hidden' name='username' value=".$username.">"
?>
<input type="text" class="input-small span4" placeholder="Answer 1" name="a1">
<br/><br/>
<legend>Security Question 2:</legend>
<?php echo "<h4>".$q2."</h4>"; ?>
<input type="text" class="input-small span3" placeholder="Answer 2" name="a2">
<br/><br/><button type="submit" class="btn">Answer Questions</button>
</form>
</div>
</div>
</div>
</section>
<?php include("include/footer.php"); ?>
</body>
</html>
<?php } ?>