title: PHP switch case problem
body: <p>I have a session variable called loggedon. I set it to 1 when the user is logged on and 0 when they are logged off.</p>
  
  <p>I do a swtich statement as seen below. but it isn't working as it should.</p>
  
  <pre><code>    $state = $_SESSION['loggedon'];
      switch ($state)
        {
          case 0:
            include("../includes/login.php");
            break;
          case 1:
            echo "logged in";
            echo "&lt;br /&gt;&lt;a href='../logoff.php'&gt;Log off&lt;/a&gt;";
          break;
          default:
            include("../includes/login.php");
  }
  </code></pre>
  
  <p>Anyone understand why?</p>
  
  <p>Cheers,</p>
  
  <p>Jonesy</p>