New admins pages

This commit is contained in:
2024-12-10 11:09:39 +01:00
parent 5ae6f24bbd
commit 4fa387e8af
6 changed files with 214 additions and 0 deletions

15
3-protect.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
// (A) START SESSION
session_start();
// (B) LOGOUT REQUEST
if (isset($_POST["logout"])) {
session_destroy();
unset($_SESSION);
}
// (C) REDIRECT TO LOGIN PAGE IF NOT SIGNED IN
if (!isset($_SESSION["user"])) {
header("Location: 1-login.php");
exit();
}