It's also my first time using sessions, although it's easy enough to understand.
What I've got is a login.php page, which when logged in redirects to staffindex.php, where they can choose what they want to do.
What I'm trying to do is stop people jumping straight to staffindex.php, but I'm having difficulty.
What I've tried:
Code: Select all
<?php
session_start();
if(!isset($_SESSION['username']) || $_SESSION !== true){
header('location:login.php');
exit();
}
?>This doesn't work....well it does...ish
When I try go straight to that page it does redirect me....but when I log on, it just keeps jumping straight to login.php again.
I hope this makes sense.