Frequently Asked Questions
Do I have to wrap the PHP code in special tags?
No, you can use the regular PHP tags directly. eg:
<?php phpinfo(); ?>
Can I use predefined Joomla variables?
Yes, but you first have to declare them as globals. eg:
global $mainframe;
Can I include PHP files?
Yes, but make sure you use the full path to the PHP files. It's just easier.
Example: Joomla1.0
global $mainframe;
include($mainrame->getCfg('absolute_path').'/modules/mod_php/includes/my_php_file.php');
Example: Joomla1.5
include(JPATH_ROOT.'/modules/mod_php/includes/my_php_file.php');
Can I use PHP Component in a module position?
No, but we have a module that does this called the
Joomla PHP Module.