Hi guys. I would like to kindly ask how would you display user's username once he/she logged-in to your site?
Let's say I have home.php and I have a log-in form on my header.
How would I display the user's username on the same position of my log-in form?
How would I hide the log-in form once the user's username is displayed?
Thanks guys..
display user's user when logged in.
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: display user's user when logged in.
You should check whether a user is logged in, if so, display the username, else display the form
Code: Select all
<?php
// pseudo-code
if (isset($username)) {
echo $username;
}
else {
echo $form;
}
?>“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering