This commit is contained in:
biglyderv 2024-12-01 07:04:33 -05:00
parent 62aea1726e
commit c2f1067e5e
2 changed files with 14 additions and 0 deletions

13
docs/logout.php Normal file
View file

@ -0,0 +1,13 @@
<?php
require("../libs/page.php");
page_header();
if (isset($_COOKIE)) {
foreach ( $_COOKIE as $key => $value )
{
setcookie( $key, FALSE );
}
header("Location: /");
die();
}
page_footer();
?>

View file

@ -17,6 +17,7 @@
<?php <?php
if (isset($username)) { ?> if (isset($username)) { ?>
<a class="header-link" href="/user.php?id=<?php echo $username ?>"><?php echo $username ?></a> <a class="header-link" href="/user.php?id=<?php echo $username ?>"><?php echo $username ?></a>
<a class="header-link" href="/logout.php">Logout</a>
<?php } else { ?> <?php } else { ?>
<a class="header-link" href="/login.php">Login</a> <a class="header-link" href="/login.php">Login</a>
<?php } <?php }