I'm trying to check if the user is currently logged in or not.
If the user is logged in, I want to echo the correct <li>
's to the menu.
I tried doing this at the top of the page:
<?php
// Report all PHP errors (see changelog)
error_reporting(E_ALL);
require_once ('models/config.php');
//$username = $loggedInUser->username;
if ($isUserLoggedIn()) {
$r1 = $loggedInUser->username;
$r2 = "Logout";
} else {
$r1 = "Login";
$r2 = "Register";
}
?>
and here's the <li>
tags:
<li><a class="short" href="About" style="display: block;"><?php echo $r1 ?></a></li>
<li><a class="short" href="About" style="display: block;"><?php echo $r2 ?></a></li>