I am setting up a header dependent on user status 0 = member 1 = Admin and everything else(not signed up) to be shown different types. I am having difficulty with my if else statements... Any suggestions would be much appreciated.

        <?php
        if(isset($_SESSION['user']))//and the session is not an admin as he is asigned the user_id of 1 in the db
        {if ($_SESSION['user_id'] == '1'){?>
          <ul class="navlink" id="logout">
          <li><a href="profile.php"><img src="img/profile.svg" alt="" class="profile-icon"></a></li>
            <li><a href="./logout.php" class="loginbtn">Logout</a>
          </ul>  <?php

        else if($_SESSION['user_id'] == '0'){?>
              <ul class="navlink" id="logout">
              <li><a href="profile.php"><img src="img/profile.svg" alt="" class="profile-icon"></a></li>
                <li><a href="./logout.php" class="loginbtn">Logout</a>
              </ul>  <?php
        else{ ?>
        <ul class="navlink" id="login">
          <li><a href="register.php">Register</a></li>
          <li><a href="login.php" class="loginbtn">Login</a>
        </ul>
      <?php
      }
      ?>

1 Answers

0
Man87 On Best Solutions

Hello James you have not closed the if as well as the else if condition please do that