/
3strikes.php
88 lines (82 loc) · 1.69 KB
/
3strikes.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
<?
error_reporting(0);
$message = "";
$username = "";
if (isset($_POST['action']) && $_POST['action'] == "Submit")
{
if ($_POST['username'] != "" && ($_POST['password'] != "" ))
{
if ($_POST['username'] == "KDG" && ($_POST['password'] == "KDG"))
$message = "Access Granted..";
else
{
$attempt = $_POST['attempt'];
if ($attempt == 3)
{
echo "<SCRIPT>window.opener=self;window.close();</SCRIPT>";
}
$message = "Access Denied..";
$username = $_POST['username'];
}
}
else
{
$attempt = $_POST['attempt'];
if ($attempt == 3)
{
echo "<SCRIPT>window.opener=self;window.close();</SCRIPT>";
}
$message = "Username/Password must not be empty..";
$username = $_POST['username'];
}
}
?>
<html>
<head>
<title>
:: Login ::
</title>
</head>
<body>
<center>
<br>
<form method="post" action="login.php">
<table border=1 cellpadding="2" cellspacing="2">
<tr>
<td COLSPAN="2" align="center">LOGIN</td>
</tr>
<tr>
<td COLSPAN="2" align="center" nowrap><?=$message?> </td>
</tr>
<tr>
<td>Username: </td> <td><input type="text" name="username" value="<?=$username?>"></td>
</tr>
<tr>
<td>Password: </td> <td><input type="password" name="password"></td>
</tr>
<tr>
<td COLSPAN="2" align="center"><input type="hidden" value="
<?if ($attempt ==1)
{
$attempt = 1 + 1;
echo $attempt;
}
else if ($attempt ==2)
{
$attempt = 2 + 1;
echo $attempt;
}
else
{
echo "1";
}
?>
" name=attempt>
<input type="submit" value="Submit" name="action" /> <input type="reset" value="Clear" />
</td>
</tr>
</table>
</form>
</center>
</body>
</html>