I'm trying to code my login page so if the user goes to www.mysite.com/login.php and they are already logged in, it will rediect them to index.php
Guess I should use something like:
if($_SESSION['loggedin']==0) { header("Location: index.php");exit; }
How would I reverse that?
if($_SESSION['loggedin']==1) { header("Location: index/");exit; }
But that doesn't work, any help would be much appreciated.
Thanks