<?php
if ($_server [' Request_method ']== ' POST ') {
Get UserNames and Passwords.
$Logi = File ("Users/log.txt");
Work out how many there are
$size = sizeof ($Logi);
Break apart passwords and usernames
foreach ($Logi as $Key => $Val)
{$Data [$Key] = explode ("| |", $Val);}
Run through list and if any match
for ($K = 0; $K < $size; $K + +)
{
$user = $Data [$K] [0];
$pass = $Data [$K] [1];
If Match set cookie and redirect.
if ($user = = Trim (addslashes ($_post ["User"]) && $pass = = Trim (addslashes ($_post ["Pass"]))
{
Setcookie ("In", 1, Time () + 3600);
Start hidden page
Header ("Location:www.111cn.net");
}
}
echo "Login Failed."
If you are didnt log in show login form
else {?>
<div style= "width:250px" >
<div><strong>black Sheep E-team login</strong></div>
<div><form name= "Login" method= "post" action= "<?=$_server [' php_self '];?>" >
<div align= "Right" >username:
<input name= "User" type= "text" >
<br>
Password:
<input name= "pass" type= "password" >
<br>
<input type= "Submit" name= "submit" value= "Submit" >
</div>
</form>
</div></div>
<?php
}
?>