hashkash Posted December 22, 2006 Share Posted December 22, 2006 Hello!Im using Joomla to develop a portal.Im posting here bcoz i need some help with my php script.Basically i need to extract the user name of the user that has logged in i.e when he clicks on a linkI would like to retrieve certain information regarding that user.People have told me that i can get it by a global variable $my->username.I keep getting REstricted access.Could anyone who has used Joomla please help me[code]defined ('_VALID_MOS') or die('Restricted access');global $my;echo $my->username;[/code] Quote Link to comment Share on other sites More sharing options...
thirdpersonmatt Posted December 26, 2006 Share Posted December 26, 2006 Well, it sounds like the reason you're getting the "Restricted Access Error" is because you're looking for a constant that hasn't been defined. You can't expect to use joomla's session/login information if you don't include all of the neccessary configuration/function files. I'm not exactly sure what exactly that entails but this should get you headed in the right direction:[code]// Set flag that this is a parent filedefine( '_VALID_MOS', 1 );require( 'globals.php' );require_once( 'configuration.php' );require_once( 'includes/joomla.php' );[/code]You would place that at the top of your code. Make sure all the paths accurate as well. Quote Link to comment Share on other sites More sharing options...
matt2501 Posted December 27, 2006 Share Posted December 27, 2006 Go to http://forum.joomla.org/index.php/topic,89865.0.html, login (or register) and download the attachment, then use it to replace your current one, unzip and place into "/administrator/components/com_mambots" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.