-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpassHandler.php
More file actions
47 lines (42 loc) · 875 Bytes
/
passHandler.php
File metadata and controls
47 lines (42 loc) · 875 Bytes
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
<?php
//starting session
session_start();
//check for attempts and then sets cookie
$doo = "banish";
$nono = 0;
if($_SESSION["attempt"] == 3)
{
//set cookie, expire in 2 hours
setcookie($doo,$nono, time() + 7200, "/");
$_SESSION["attempt"] = 0;
}
?>
<html>
<body>
<h2>Checking...<h2>
<?php
//password variable
$password = "bo";
if ($_POST["pass"] == $password)
{
//setting session variable
$_SESSION["SecretKey"] = "enter";
echo "<script type = 'text/javascript'>\n";
echo "window.location= 'Test.html';\n";
echo "</script>";
exit();
}
else
{
//Setting session variable
$_SESSION["SecretKey"] = "close";
//attempt counter
$_SESSION['attempt'] += 1;
echo "<script type = 'text/javascript'>\n";
echo "window.location= 'index.php';\n";
echo "</script>";
exit();
}
?>
</body>
</html>