I had the following code at the top of a page thinking that it prevented the rest of the page from executing if the condition was met.
Obviously the simple solution would be to add an else clause such as..PHP Code:if(!$um->isLoggedinUser())
header('Location: index.php');
Or another option would be,PHP Code:if(!$um->isLoggedinUser()){
header('Location: index.php');
}
else{
//Execute the rest of the page
}
But I was surprised that the header function waited until the end of the page to work. Is that a configuration thing, or just the norm?PHP Code:if(!$um->isLoggedinUser()){
header('Location: index.php');
die();
}






Bookmarks