HI,
I hope someone can help. I'm trying to show the username of the logged in user on this menu.inc page and certain pages only when logged in.
The result I have with the code below is no username showing, just "Hi !" (the "login" link disappear as planned) and all pages showing (logged and un-logged)
thank you for your help
I hope someone can help. I'm trying to show the username of the logged in user on this menu.inc page and certain pages only when logged in.
The result I have with the code below is no username showing, just "Hi !" (the "login" link disappear as planned) and all pages showing (logged and un-logged)
thank you for your help
Code:
<div style="margin-bottom: 0px; margin-left: auto; margin-right: auto; margin-top: 0px; overflow: visible;">
<div align="center">
<table border="0">
<tr>
<th>
<span class="small">
<?php if ($_SESSION["loggedInUser"] == $_SESSION["userCakeUser"]) { ?>Hi <strong><?php echo $_SESSION[$userdetails["Username"]]; ?>
!
<?php } else { ?><a href="login.php">Login</a>
<?php } ?>
</span> </th>
</tr>
<tr>
<td>
<span class="small">
<?php if ($_SESSION['loggedInUser'] == $_SESSION["userCakeUser"]) { ?><a href="logout.php">Logout</a>
<?php } else { ?>Register <a href="register.php" class="text_left">here </a>to download full mixes<?php } ?>
</span>
</td>
</tr>
</table>
</div>
<hr width=600px>
<a href="<?php echo $main_path; ?>index.php">Welcome</a><a href="
<?php echo $main_path; ?>Bio.php">Bio</a>
<!--logged-in-->
<?php if ($_SESSION['loggedInUser'] == $_SESSION["userCakeUser"]) { ?>
<a href="<?php echo $main_path; ?>Mixes.php">Mixes</a>
<a href="<?php echo $main_path; ?>Production.php">Production</a>
<?php } ?>
<!--not-logged-in-->
<?php if ($_SESSION['loggedInUser'] == NULL) { ?>
<a href="<?php echo $main_path; ?>mixes_unlogged.php">Mixes</a>
<a href="<?php echo $main_path; ?>production_unlogged.php">Production</a>
<?php } ?>
<a href="<?php echo $main_path; ?>Contact.php">Contact</a>
<a href="<?php echo $main_path; ?>links.php">Links</a>
<hr width=500px>
Comment