Tuesday, November 12, 2013

How to get user data in joomla root page [SOLVE]

How to get user data in joomla root page  external
 
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define( 'JPATH_BASE', $_SERVER[ 'DOCUMENT_ROOT' ] );
... then you need to include three files, like:
require_once( JPATH_BASE . DS . 'includes' . DS . 'defines.php' );
require_once( JPATH_BASE . DS . 'includes' . DS . 'framework.php' );
require_once( JPATH_BASE . DS . 'libraries' . DS . 'joomla' . DS . 'factory.php' );
$mainframe =& JFactory::getApplication('site');
EDIT.. ... or you can include only two files like:
require_once( JPATH_BASE . 'libraries' . DS . 'import.php' ); // framework
require_once( JPATH_BASE . 'configuration.php' ); // config file
... and finally use joomla class, like:
$db = JFactory::getDBO();

No comments:

Post a Comment