title: Using sessions to grant user admin to page
body: <p>I am doing an exercise for a class where a simple multi page website is made. One of the pages, the 'addeddit.php' page requires the user to be an administrator. However, if the user of the website is a broker then they should be denied access to this page.</p>
  
  <p>I am unsure of how to correctly code the 'addedit.php' page.</p>
  
  <p>I have a database saved with the username and password as well as a 'Y' or 'N' if they are an admin.
  The php for my login page is as follows and I have added the $isadmin variable.</p>
  
  <p>My 'addedit.php' code thus far is as follows:
  session_start();</p>
  
  <pre><code>&lt;?php
  session_start();
  
  if($isadmin==true){
  header("location:addedit.php");
  exit;
  }
  else
  {
  echo "Sorry, you must be an administrator to view this";
  }
  }
  ?&gt;
  </code></pre>