title: Logout button does not appear after user logs in
body: <p>After users log in, they should be able to see logout but the problem is they can only see login button. Logout button is missing. I am using slide down panel. I know I'm missing some conditional clause(?) in my html but I just know how and where to write it. Please help me. </p>
  
  <p>html/index.php</p>
  
  <pre><code>    &lt;div id="toppanel"&gt;
      &lt;div id="panel"&gt;
          &lt;div class="content clearfix"&gt;
              &lt;div class="left"&gt;
                  &lt;!-- Login Form --&gt;
                  &lt;form class="clearfix" action="validate2.php" method="post"&gt;
                      &lt;h1&gt;Member Login&lt;/h1&gt;
                      &lt;label class="grey" for="log"&gt;Email:&lt;/label&gt;
                      &lt;input class="field" type="text" name="email" id="log" value="" size="23" /&gt;
                      &lt;label class="grey" for="pwd"&gt;Password:&lt;/label&gt;
                      &lt;input class="field" type="password" name="password" id="pwd" size="23" placeholder="********" /&gt;
                      &lt;label&gt;&lt;input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /&gt; &amp;nbsp;Remember me&lt;/label&gt;
                      &lt;div class="clear"&gt;&lt;/div&gt;
                      &lt;input type="submit" name="submit" value="Login" class="bt_login" /&gt;
                      &lt;a class="lost-pwd" href="#"&gt;Lost your password?&lt;/a&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
              &lt;div class="left"&gt;          
                  &lt;!-- Register Form --&gt;
                  &lt;form action="#" method="post"&gt;
                      &lt;h1&gt;Not a member yet? Sign Up!&lt;/h1&gt;             
                      &lt;label class="grey" for="email"&gt;Email:&lt;/label&gt;
                          &lt;input class="field" type="text" name="email" id="signup" value="" size="23" /&gt;
                      &lt;label class="grey" for="password"&gt;Password:&lt;/label&gt;
                          &lt;input class="field" type="text" name="password" id="email" size="23" placeholder="********" /&gt;
                      &lt;label class="grey" for="email"&gt;Confirm Password:&lt;/label&gt;
                          &lt;input class="field" type="text" name="password" id="email" size="23" placeholder="********" /&gt;
              &lt;/div&gt;
              &lt;div class="left right"&gt;
                      &lt;label class="grey" for="email"&gt;Contact No&lt;/label&gt;
                          &lt;input class="field" type="text" name="email" id="signup" value="" size="23" /&gt;
                      &lt;label class="grey" for="email"&gt;Campus&lt;/label&gt;
                      &lt;br&gt;
                          &lt;input type="radio" name="campus" /&gt;&lt;?php if (isset($campus) &amp;&amp; $campus=="Jerudong")?&gt;&lt;value="Jerudong"&gt;Jerudong
                          &lt;input type="radio" name="campus" /&gt;&lt;?php if (isset($campus) &amp;&amp; $campus=="Gadong") ?&gt;&lt;value="Gadong"&gt;Gadong
                      &lt;label class="grey" for="email"&gt;Class&lt;/label&gt;
                          &lt;input class="field" type="text" name="email" id="signup" value="" size="23" /&gt;
                      &lt;label class="grey" for="email"&gt;Intake&lt;/label&gt;
                          &lt;input class="field" type="text" name="email" id="signup" value="" size="23" /&gt;
                      &lt;input type="submit" name="submit" value="Register" class="bt_register" /&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt; &lt;!-- /login --&gt;
      &lt;/div&gt;
      &lt;!-- The tab on top --&gt; 
      &lt;div class="tab"&gt;
          &lt;ul class="login"&gt;
              &lt;li class="left"&gt;&amp;nbsp;&lt;/li&gt;
              &lt;li&gt;Hello!&lt;/li&gt;
              &lt;li class="sep"&gt;|&lt;/li&gt;
              &lt;li id="toggle"&gt;
                  &lt;a id="open" class="open" href="#"&gt;Log In | Register&lt;/a&gt;
                  &lt;a id="close" style="display: none;" class="close" href="#"&gt;Close Panel&lt;/a&gt;         
              &lt;/li&gt;
              &lt;li class="right"&gt;&amp;nbsp;&lt;/li&gt;
          &lt;/ul&gt; 
      &lt;/div&gt; &lt;!-- / top --&gt;
  
  &lt;!-- The tab on top --&gt;
      &lt;div class="tab"&gt;
          &lt;ul class="login"&gt;
              &lt;li class="left"&gt; &lt;/li&gt;
              &lt;!-- Logout --&gt;
              &lt;li&gt;Hello, &lt;?php echo $_SESSION['email'] ?&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="logout.php"&gt;Log Out&lt;/a&gt;&lt;/li&gt;
              &lt;li class="sep"&gt;|&lt;/li&gt;
  
              &lt;li id="toggle"&gt;
              &lt;a id="open" class="open" href="#" rel="nofollow"&gt;Show Dashboard&lt;/a&gt;
              &lt;a id="close" style="display: none;" class="close" href="#" rel="nofollow"&gt;Close Panel&lt;/a&gt;
              &lt;/li&gt;
              &lt;li class="right"&gt; &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt; &lt;!-- / top --&gt;
  </code></pre>
  
  <p>validate2.php</p>
  
  <pre><code>&lt;?php 
  
  include 'connection.php';
  if (isset($_POST["login"])){
  //get data from login form
  $email = mysql_real_escape_string($_POST["email"]);
  $password = mysql_real_escape_string($_POST["password"]);
  
  //select all data by using email and password entered
  $customers = mysql_query("select * from customer where CustomerEmail='".$email."' and CustomerPassword='".$password."'");
  $customer = mysql_num_rows($customers);
  
  $managers = mysql_query("select * from manager where ManagerEmail='".$email."' and ManagerPassword='".$password."'");
  $manager = mysql_num_rows($managers);
  
  $staffs = mysql_query("select * from staff where StaffEmail='".$email."' and StaffPassword='".$password."'");
  $staff = mysql_num_rows($staffs);
  
      //if customer is true
      if($customer== 1){
          $row = mysql_fetch_assoc($customers);
          $id= $row['CustomerID'];
          $email = $row['CustomerEmail'];
          $name = $row['CustomerName'];
  
          //start session
          session_start();
          //create session
          $_SESSION['CustomerID'] = $id;
          $_SESSION['CustomerEmail'] = $email;
          $_SESSION['CustomerName'] = $name;
  
          //redirect page to index.php    
          header("Location: index.php");
          }
  
      //if manager is true
      else if($manager == 1){
          $row = mysql_fetch_assoc($managers);
          $id = $row['ManagerID'];
          $email = $row['ManagerEmail'];
          $name = $row['ManagerName'];
  
          //start session
          session_start();
          //create session
          $id = $row['ManagerID'] = $id;
          $_SESSION['ManagerEmail'] = $email;
          $_SESSION['ManagerName'] = $name;
  
          //redirect page to managerCP.php
          header("Location: managercp.php");
          }
  
      //if staff is true
      else if($staff == 1){
          $row = mysql_fetch_assoc($staff);
          $id = $row['StaffID'];
          $email = $row['StaffEmail'];
          $name = $row['StaffName'];
  
          //start session
          session_start();
          //create session
          $id = $row['StaffID'] = $id;
          $_SESSION['StaffEmail'] = $email;
          $_SESSION['StaffName'] = $name;
  
          //redirect page to staffCP.php
          header("Location: staffcp.php");
          }
  
      //if all condition is false 
      else    {
  //alert will be appeared
  header("Location: index.php?login=Wrong email or password");    
  }
  }
  ?&gt;
  
  
  &lt;/div&gt;
  </code></pre>
  
  <p>So I edited and I got an error that says unexpected 'else'.</p>
  
  <pre><code>    &lt;li class="left"&gt; &lt;/li&gt;
      &lt;?php if(isset($_GET['login'])) {?&gt;
      &lt;!-- Logout --&gt;
      &lt;li&gt;Hello, &lt;?php echo $_SESSION['email'] ?&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="logout.php"&gt;Log Out&lt;/a&gt;&lt;/li&gt;
      &lt;li class="sep"&gt;|&lt;/li&gt;
      &lt;?php } ?&gt;
      &lt;?php else { ?&gt;
      &lt;div class="content clearfix"&gt;
              &lt;div class="left"&gt;
                  &lt;!-- Login Form --&gt;
                  &lt;form class="clearfix" action="validate2.php" method="post"&gt;
                      &lt;h1&gt;Member Login&lt;/h1&gt;
                      &lt;label class="grey" for="log"&gt;Email:&lt;/label&gt;
                      &lt;input class="field" type="text" name="email" id="log" value="" size="23" /&gt;
                      &lt;label class="grey" for="pwd"&gt;Password:&lt;/label&gt;
                      &lt;input class="field" type="password" name="password" id="pwd" size="23" placeholder="********" /&gt;
                      &lt;label&gt;&lt;input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /&gt; &amp;nbsp;Remember me&lt;/label&gt;
                      &lt;div class="clear"&gt;&lt;/div&gt;
                      &lt;input type="submit" name="submit" value="Login" class="bt_login" /&gt;
                      &lt;a class="lost-pwd" href="#"&gt;Lost your password?&lt;/a&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
              &lt;div class="left"&gt;          
                  &lt;!-- Register Form --&gt;
                  &lt;form action="#" method="post"&gt;
                      &lt;h1&gt;Not a member yet? Sign Up!&lt;/h1&gt;             
                      &lt;label class="grey" for="email"&gt;Email:&lt;/label&gt;
                          &lt;input class="field" type="text" name="email" id="signup" value="" size="23" /&gt;
                      &lt;label class="grey" for="password"&gt;Password:&lt;/label&gt;
                          &lt;input class="field" type="text" name="password" id="email" size="23" placeholder="********" /&gt;
                      &lt;label class="grey" for="email"&gt;Confirm Password:&lt;/label&gt;
                          &lt;input class="field" type="text" name="password" id="email" size="23" placeholder="********" /&gt;
              &lt;/div&gt;
              &lt;div class="left right"&gt;
                      &lt;label class="grey" for="email"&gt;Contact No&lt;/label&gt;
                          &lt;input class="field" type="text" name="email" id="signup" value="" size="23" /&gt;
                      &lt;label class="grey" for="email"&gt;Campus&lt;/label&gt;
                      &lt;br&gt;
                          &lt;input type="radio" name="campus" /&gt;&lt;?php if (isset($campus) &amp;&amp; $campus=="Jerudong")?&gt;&lt;value="Jerudong"&gt;Jerudong
                          &lt;input type="radio" name="campus" /&gt;&lt;?php if (isset($campus) &amp;&amp; $campus=="Gadong") ?&gt;&lt;value="Gadong"&gt;Gadong
                      &lt;label class="grey" for="email"&gt;Class&lt;/label&gt;
                          &lt;input class="field" type="text" name="email" id="signup" value="" size="23" /&gt;
                      &lt;label class="grey" for="email"&gt;Intake&lt;/label&gt;
                          &lt;input class="field" type="text" name="email" id="signup" value="" size="23" /&gt;
                      &lt;input type="submit" name="submit" value="Register" class="bt_register" /&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt; &lt;!-- /login --&gt;
  &lt;?php } ?&gt;
  </code></pre>