Init commit

This commit is contained in:
Archie Fox
2024-06-08 14:22:07 +03:00
commit a9853c39cc
9 changed files with 201 additions and 0 deletions

28
secret.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
session_start();
$title = 'Secret page';
if (!$_SESSION['id'] || !$_SESSION['name']) {
header("Location: index.php");
exit();
}
echo 'Your ID: ' . $_SESSION['id'] . "</br>";
echo 'Your Name: ' . $_SESSION['name'] . "</br>";
if ($_GET['do'] === 'logout') {
session_destroy();
header("Location: index.php");
exit();
}
?>
<?php require_once 'templates/header.php'; ?>
<div>
<a href="?do=logout">Logout</a>
</div>
<?php include_once 'templates/footer.php'; ?>