#!/usr/bin/php -q
<?php
$isAuthenticated = false;
$realUserId = "aaa";
$realPassword = "pass";
while( $isAuthenticated!=true )
{
echo "Please login to begin: \n";
echo "Enter username: \n";
$userName = fread(STDIN,10);
echo "Enter password: \n";
$password = fread(STDIN,10);
//now check to make sure is registerd user
//$userId = $u->userLogin($userName, $password);
if($userName != $realUserId && $password != $realPassword)
echo "Invalid username or password. Please try again.\n";
else
{
echo " You are logged in! You can begin.\n";
$isAuthenticated = true;
}
}
?>