<?php
session_start();
if (empty($_SESSION['id'])) {
$_SESSION['errMsg'] = '<div class="alert alert-danger" role="alert">
<strong>Post:</strong> You must be logged in `enter code here`in order to post.
</div>';
header('Location: ../../index.php');
exit;
}
?>
It just doesn't redirect me to index.php, which is in the proper place, even though the session doesn't exist.