Files
mystat/secret.php
Archie Fox a9853c39cc Init commit
2024-06-08 14:22:07 +03:00

28 lines
487 B
PHP

<?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'; ?>