logout
This commit is contained in:
parent
62aea1726e
commit
c2f1067e5e
2 changed files with 14 additions and 0 deletions
13
docs/logout.php
Normal file
13
docs/logout.php
Normal 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();
|
||||
?>
|
|
@ -17,6 +17,7 @@
|
|||
<?php
|
||||
if (isset($username)) { ?>
|
||||
<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 { ?>
|
||||
<a class="header-link" href="/login.php">Login</a>
|
||||
<?php }
|
||||
|
|
Loading…
Reference in a new issue