title: sql / php - login check
body: <p>I have a file that I include on all my webpages that contains the $db_login_status.
  It is set at 0 in that file and when you type in the correct information on my login page, it sets </p>
  
  <pre><code>$db_login_status = 1;
  </code></pre>
  
  <p>or,</p>
  
  <pre><code>$db_login_status = 2;
  </code></pre>
  
  <p>depending on the level of user.</p>
  
  <p>I am trying to redirect someone back to the login page if they are not logged in, but this code just makes my page not load. Does not redirect me at all.</p>
  
  <p>Am I going wrong somewhere in here? 
  Thanks.</p>
  
  <pre><code>&lt;?php
  
  // ----------------------
  // Check for logged in
  
  if ($db_login_status = 0;) {
       header("location: index.php");
       exit();
  }
  
  ?&gt;
  </code></pre>