<li class="dropdown">
<a href="signin.php" class="dropbtn">Account</a>
<div class="dropdown-content">
<?php
if(isset($_SESSION['on'])) {
echo '<a href="logout.php">Log out</a>';
}
else if (!isset($_SESSION['on'])) {
echo '<a href="signin.php">Sign in</a>';
echo '<a href="signup.php">Sign up</a>';
}
?>
</div>
</li>
So what this is supposed to do is when ur not signed in u get to see the signin and signup dropdown buttons and not the logout. This part works. But as soon as u log in, in stead of showing the log out button and nothing else, it only shows the sign in and sign up buttons. How do i fix this?
else ifis totally redundant; just useelse. Have you calledsession_start()before this (or any other) HTML output?session_start()creates a session or resumes the current one"