Hey, this is a simple question.
How can I show a login button if a user is logged out and show a logout button if a user is logged in?
Thanks
Hey, this is a simple question.
How can I show a login button if a user is logged out and show a logout button if a user is logged in?
Thanks
Assuming $_SESSION['logged-in']
is the session variable that represents the state of being logged in:
if ($_SESSION['logged-in']) {
echo '<button>log off</button>';
} else {
echo '<button>log in</button>';
}