Code: Select all
session_start();
if (empty($_SESSION['user']))
{
header('Location: login.php');
}So, were is the problem? I also have to add that I'm using a frame in my main.php but all the pages loaded in it are protected by the code above.
Moderator: General Moderators
Code: Select all
session_start();
if (empty($_SESSION['user']))
{
header('Location: login.php');
}Code: Select all
if(isset($_SESSION['user']) === false) {
header('Location: login.php');
}