i want to display logged in member username inside my nav tag but after running it doesn't display anything. i have checked the varibles $_SESSION['u_user']= $row['username']; and it displays the correct username. below is the code. please fix it.
<?php
if(isset($_SESSION['u_id'])) {
echo '<li class="dropdown"><a href="#" class="dropdown-toggle"><?php $_SESSION["u_user"]; ?><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="login">DashBoard</a></li>
<li><a href="includes/logout.php" >Log out</a></li>
</ul>
</li>';
}
else {
echo '<li class="dropdown"><a href="#" class="dropdown-toggle">Account<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="login.php">Log in</a></li>
<li><a href="signup.php">Sign up</a></li>
</ul>
</li>';
}
?>
Aucun commentaire:
Enregistrer un commentaire