implemented session assignment.

This commit is contained in:
Joshua Ashton
2025-02-09 16:53:31 -07:00
parent 6068d8ac45
commit 43b296635e
15 changed files with 524 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
session_start();
echo '
<form method="get" id="nav">
<button name="page" value="account">Account</button>
<button name="page" value="home">Home</button>
<button name="page" value="video">Video</button>
' . getLogoutButton() . '
</form>
';
function getLogoutButton()
{
if ($_SESSION['access'] === true)
return '<button name="logout" value="true" class="reset">Logout</button>';
}
if (isset($_GET['logout'])) {
$_SESSION['access'] = false;
session_destroy();
header('Location: .');
}
?>