The following header function is not working. I ma trying to go to login if the user is not logged in -
<?PHP
if (logged_in() === false) {
header('Location: login.php');
}
?>
However if I do -
<?PHP
if (logged_in() === false) {
echo"No user is logged in";
}
?>
It does echo it and I can see that it says no user is logged in
It is basically just checking if there is a user logged in
function logged_in() {
return (isset($_SESSION['user_id'])) ? true : false;
}