PHP login authentication problem (beginner)
<p>scenario is I have different access levels on this site, I have the simple login process working for all valid users however I am now trying to seperate the different users fo different access to pages.</p>

<p>here is my code at the start of my page:</p>

<pre><code>// CHECKS IF THE USER HAS LOGGED IN
session_start();

if(!isset($_SESSION['logged_in']) || !$_SESSION['logged_in']){
   header("location:index.php");
}

if(!$_SESSION['mystatus']=='1'){
   header("location:access_error.php");
}
</code></pre>

<p>so basically I want this page to only be accessible by users with the access level of 1 if they are logged in however do not have the correct access level direct them accordingly.</p>

<p>at the moment it allows users who have logged in with different access levels (e.g 3) to still view this page.</p>

<p>help please. </p>

<p>many thanks,</p>
