title: Stop logged in user seeing the log in page?
body: <p>I'm very new to php and mysql. I have found a great tutorial to create a registration and log in section on a site. I'm managing to deconstruct it pretty well and make minor changes.
  However...</p>
  
  <p>If a user logs in I am able to allow accesss to pages using -</p>
  
  <pre><code>&lt;?php
  session_start();
  
  if(!isset($_SESSION['username'])){
  header("Location: index.php");
  }
  ?&gt;
  </code></pre>
  
  <p>If a user is logged in and they revisit the 'log in' page again I don't want them to be able to see it but it redirect them to a page within the 'members area'. How can i do this?</p>