Version of script: 3.5.3
Write your message below:
Hello
I success make user authentication and store user info in session (On all pages except admin pages)
I wand to know How can i add or modify site header to add a new user profile after login (whice will contain user name and sign out link) ?
I tried to add this code to header.txt
Code: Select all
<nav>
<!-- Other nav content -->
<?php if (isset($_SESSION['user'])): ?>
<div class="user-profile" style="float: right;">
Hello, <strong><?php echo htmlspecialchars($_SESSION['user']); ?></strong>
<a href="logout.php">Sign Out</a>
</div>
<?php else: ?>
<a href="login.php">Login</a>
<?php endif; ?>
</nav>
but it appear in top upper the side header as here :

can help to understand how to make this nav in same site nav ?
thanks