MisterWebNet

<<< Coding for the future >>>

Home Coding PHP How to check if a user is logged into joomla
How to check if a user is logged into joomla PDF Print E-mail
Written by Administrator   
Tuesday, 09 February 2010 12:53

I'm using Joomla 1.5 and wanting to check if a user is logged in or not. Using Joomla variables we can check using the following piece code

$user =& JFactory::getUser();

 

This will probably have already been done if you are on a joomla page anyway. To see if the user is logged in:

 

<?php
if($user->id==0)
{

//NOT LOGGED IN
}
else
{

//LOGGED IN

}
?>

 

 

Add comment

We reserve the right to remove comments without notice. Users are responsible for their own comments and the contents contained within.


Security code
Refresh

ThugVillage.com
Mens Entertainment Magazine with girls, gadgets, indepth analysis, videos and much more
Best Flash Games
The best flash games on the net - 100% free!
HiredMedia
Off beat, deep-web, alternative videos