You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
<?php
|
|
// (A) START SESSION
|
|
session_start();
|
|
|
|
// (B) LOGOUT REQUEST
|
|
if (isset($_POST["logout"])) { unset($_SESSION["user"]); }
|
|
|
|
// (C) REDIRECT TO LOGIN PAGE IF NOT LOGGED IN
|
|
if (!isset($_SESSION["user"])) {
|
|
header("Location: ../");
|
|
exit();
|
|
} |