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 see if any match
for( $K = 0 ; $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 didnt log in show login form
} else { ?>