I have one doubt in Joomla. I can able to get the user login details while I am accessing the index.php...Whereas if i created new folder named test and inside the folder i have created index.php and i have used below code in that case user details were not showing. Please help me on this
$user =& JFactory::getUser();
if (!$user->guest) {
echo 'You are logged in as:<br />';
echo 'User name: ' . $user->username . '<br />';
echo 'Real name: ' . $user->name . '<br />';
echo 'User ID : ' . $user->id . '<br />';
}