if (isset($_SESSION['logged_in'])){ echo "Do logged in stuff"; } else { echo "You are not allowed to be here"; }