A
Anonymous
Guest
want to see if a user is not logged in can not see certain things on the website. If the user is logged the login button changes to logout. Or if a user is not logged in, can not see anything on the page, and if he is logged. I tried to session_start above but the entire page is protected and I do not. I also tried this:
But that does not work. Is there anyone who can help me?
Code:
<? Php if (isset ($ _ SESSION [ 'username'])):?>
<a href="secret/logout.php" class="btn btn-info btn-sm" role="button"> <? php echo $ _SESSION [ 'username']?; ?> </a>
<? Php else:?>
<? Php endif?; ?>
But that does not work. Is there anyone who can help me?