PHP If statement
Posted: Sun Mar 20, 2011 7:46 pm
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
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