I would like a person who is not logged in be redirected to the index page.
on my onlymembers.php I put this code:
if(!$user->is_logged_in()){ 
echo "you are not logged in";
header("Location: index.php");
} 
It is printing out "you are not logged in" which indicates that the login check is working. But I will not be redirected to the index page. Do you know why?
Update:
I used this code now and it is working:
if(!$user->is_logged_in()){ 
header("Location: index.php"); 
} 
I have actually NO idea why. I just removed some whitespaces :-/
Update again: I know now the problem: I just removed the whitespace infront my <?php at the beginning of my page....  
 
     
     
     
     
    