title: PHP and jQuery: show/hide div if user logged in or not
body: <p>EDIT:
  thanks a lot for all your comments/replies. 
  Even if i remove the JS, and use the PHP if/else statements only, i still get the same error. </p>
  
  <p>i keep on running into the same error:</p>
  
  <p>The 2 divs below are visible whereas only one of them should be shown at a time (whether or not the user is logged in).</p>
  
  <p>For simplicity purposes, i removed the html inside the 2 divs. </p>
  
  <pre><code>&lt;div id="header_wrapper"&gt;
  
  &lt;div id="loginbutton"&gt;&lt;/div&gt;
  
  &lt;div id="menu"&gt;
  &lt;ul&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;    
  &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;?php 
  if (!isset($_SESSION['id']) || empty($_SESSION['id'])){  ?&gt;
  
  &lt;script&gt;
  document.getElementById("menu").style.display = "none";
  document.getElementById("loginbutton").style.display = "show";
  &lt;/script&gt;
  &lt;?php }
  else {  ?&gt;
  &lt;script&gt;
  document.getElementById("loginbutton").style.display = "none";
  document.getElementById("menu").style.display = "show";
  &lt;/script&gt;
  
  &lt;?php 
  }
  ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The $_SESSION['id'] is not empty. Indeed if i echo $_SESSION['id'] on the page, i get the correct session #. </p>
  
  <p>Am I missing something?</p>