The code below is part of a PHP / MySQL login system that I am using. It determines whether or not the login fields are displayed, and it is supposed to only display them when the user is not logged in. Sometimes it displays them when is user is logged in, logging the user out.
Any ideas on what I should look for to trouble shoot this?
Thanks in advance,
John
<?php
if (!isLoggedIn())
{
if (isset($_POST['cmdlogin']))
{
if (checkLogin($_POST['username'], $_POST['password']))
{
show_userbox();
} else
{
echo "Incorrect Login information !";
show_loginform();
}
} else
{
show_loginform();
}
} else
{
show_userbox();
}
?>