Code: Select all
<?php
if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']))
{
// let the user access the restricted page
}
elseif(!empty($_POST['username']) && !empty($_POST['password']))
{
// let the user login
}
else
{
// display the login form
}
?>