So I have this code on my login.php
that when the user and password matches with the database it will redirect to another page which requires logging in first before it can be accessible.
Here is my code in login
$_SESSION['userlog'] = true;
header('location: table.php');
And here is my code that requires logging in before the page become accessible.
if(empty($_SESSION['userlog']))
{
header('LOCATION: login.php');
}
The problem is when I click on login, it does not redirect in the next page. Any idea what is wrong or missing in my code?