Hi
Our host is Siteground
We have used this code in Joomla 3 as a header.php file we include at the top of other PHP files
<?php
/* header file to access joomla */
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__DIR__));
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe = JFactory::getApplication('site');
//$mainframe->initialise();
/* If you need to use database object, add following line too */
$db=JFactory::getDBO(); // use this $db object for database related operation
?>
But now we try to upgrade to Joomla 4 this no longer works
Are things different in J4
Any help would really be appreciated
Cheers
Rich
Our host is Siteground
We have used this code in Joomla 3 as a header.php file we include at the top of other PHP files
<?php
/* header file to access joomla */
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__DIR__));
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe = JFactory::getApplication('site');
//$mainframe->initialise();
/* If you need to use database object, add following line too */
$db=JFactory::getDBO(); // use this $db object for database related operation
?>
But now we try to upgrade to Joomla 4 this no longer works
Are things different in J4
Any help would really be appreciated
Cheers
Rich
Statistics: Posted by perryworld — Mon May 27, 2024 8:32 pm