Init commit
This commit is contained in:
28
secret.php
Normal file
28
secret.php
Normal 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'; ?>
|
||||
Reference in New Issue
Block a user