-
Notifications
You must be signed in to change notification settings - Fork 11
/
pass.php
executable file
·53 lines (51 loc) · 1.18 KB
/
pass.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
<?php
include ('verify.php');
$encryptedpasswd= getpass() ;
$showlogin = true ;
// check cookie
if (isset($_COOKIE['logincheck']))
{
if (md5($encryptedpasswd) == $_COOKIE['logincheck'])
{
$showlogin = false ;
}
}
?>
<?php
if (isset($_POST['pass']) )
{
if (verifyPassword($_POST['pass'])!='right')
{
echo ('<center><font color="red">Password incorrect. </font></center>');
}
else
{
$showlogin= false; // the pass is good
setcookie("logincheck",md5($encryptedpasswd),time()+3600);// expire in 1 hour
}
}
else
{
; // no login attempt
}
if ($showlogin) {
?>
<div class="row">
<div class="col-lg-6">
<form name="sql-data" method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
<div class="input-group">
<span class="input-group-btn">
<button class='btn btn-default' type="submit" value="Submit">Submit</button>
</span>
<input class="form-control" type="password" name="pass" value ="" placeholder="Enter your password to continue" maxlength="60" size="30">
</div><!-- /input-group -->
</form>
</div><!-- /.col-lg-6 -->
</div>
</div>
<?php include ("footer.php");?>
<?php
}
if ($showlogin) die() ;
?>
<!-- normal continuation of page here.... -->