I got that code from another site!
So - sorry - I've tried so many things after your reply and keep getting in knots!
My code looks like this. I want it to continue to display the page if there IS a logged in user, and go back to the login page if not.
<?
// Enable sessions
session_start();
// Turn on magic quotes to prevent SQL injection attacks
if(!get_magic_quotes_gpc())
set_magic_quotes_runtime(1);
// Check if they are logged in
if (!isset($_SESSION['loggedInUser']);
?>
It says Unexpected ';' whether I put that final ':' in or not! So I cannot get to actually see what happens if/when it works.
Also should I add this or not:
{
// not logged in, move to login page
header('Location: login.php');
exit;
}