What i am trying to do is redirect the logged in member to index2.php if he try to move back to index.php
I put this piece of code on the very top of index.php :
<?php
session_start();
if (isset($_SESSION['uid'])) {
header ("Location :index2.php");
} else {
session_unset();
session_destroy();
}
the expected behavior for this code is to redirect the member back to index2.php but it does not and index.php is running , how can i fix that ?
Perhaps this is because of your space within the code? Try this…
Notice the change to
location: