Security issuse about header ('location: some_page.php')
<p>I have a question about header('location: ----.php') is it safe for ADMIN to use this function to restrict USER access for some pages.For example if user is not ADMIN can I use this function to restrict the user to see some pages? Is this a good way to secure some pages from unauthorized access of user? If not can someone giv me a proposal for secure restriction? Thanks. </p>

<p>for example I'm using this for restriction:</p>

<pre><code>             $id = $_SESSION['id'];
             $queryget = mysql_query("SELECT * FROM users WHERE id='$id'"); 
             $row_12 = mysql_fetch_assoc($queryget);
             $admin = $row_12['admin_id'];
             $ruka = $row_12['rukovoditelj'];


                if($row_12['admin_id'] &gt; 1)
                {

                     header('Location: dosjei.php');


               }
</code></pre>
