Okay, I'm using a php script: login.php to process login information. Since I am only having 3 users I do not need a database and passwords will be changing constantly anyway. Here's my login.php script.
<?php
$passwords = array("user1" => "pass1",
"user2" => "pass2",
"user3" => "pass3");
if ($password == $passwords[$username])
{
setcookie("username", $username, time()+1200);
//redirect to secure page
}
else
{
setcookie("username", "", time()-3600);
//redirect to login
}
?>
What I need is help with code that redirects the user to a secure page if the login is correct or back to the page containing the login form if it's incorrect. I know it's simple but it keeps messing up on me. Also, I need something that runs a check to see if a user is currently logged in so that no one else may log-in with someone else's information.
Thanks for the help!