I might be nitpicking, but is it better to do this:
if ($loggedin) {
// normal process
}
else {
header('Location: login.php');
}
Or this:
if (!$loggedin) {
header('Location: login.php');
exit();
}
// normal process
Or does it just not matter?