I'm looking for my website to show the username of the customer, once they have logged into the website. And if they haven't then i want it to show 'guest'
I wondered if anyone could help me?
I'm using joomla 1.5. I know that the code below shows the username, once the user has logged in.
But how can i make it say 'Welcome: Guest' or if possible have the whole box disapear, if they have not logged in.
<?php
$user =& JFactory::getUser();
$welcome = 'Welcome: ';
echo $welcome.$user->username;
?>
Using VM1.1.7
Kind Regards
Paul
PHP If statement
Moderator: General Moderators
Re: PHP If statement
u can save the session in a file or table, if the guest have not logged in, the guest name is empty
Re: PHP If statement
if they register have it send their information to a database using a form. if they have not logged in yet, make an if() function that if the user info isnt in the database, have the php echo out a div that welcomes them. or vice versa