The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri May 04, 2012 9:09 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Wed Dec 22, 2010 12:00 pm
Posts: 158
Hello

I have tried

require_once JPATH_BASE.DS.'includes'.DS.'framework.php';
jimport( 'joomla.user.user' );
$user =& JFactory::getUser();

but I dont get $user->name or any value

which require_once and jimport are necessary ?

thank you


Last edited by imanickam on Sun May 06, 2012 8:53 am, edited 1 time in total.
Moved the topic from the forum General Questions to the forum Joomla! Coding


Top
 Profile  
 
PostPosted: Mon May 07, 2012 3:12 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Sat Dec 06, 2008 7:07 pm
Posts: 281
You don´t need anything else than
Code:
$user =& JFactory::getUser();
echo $user->name;

_________________
http://www.ratmilwebsolutions.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 



Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group