Actions

Difference between revisions of "Why do most of the Joomla! PHP files start with "defined(' JEXEC')...?"

From Joomla! Documentation

m (Adjusted layout)
m (clean up categories with <noinclude> tags)
Line 7: Line 7:
 
However, this line should NOT be included in your main index.php file, since this is the program that starts the Joomla! session.
 
However, this line should NOT be included in your main index.php file, since this is the program that starts the Joomla! session.
  
[[Category:FAQ]]
+
<noinclude>[[Category:FAQ]]
 
[[Category:Administration FAQ]]
 
[[Category:Administration FAQ]]
[[Category:Version 1.5 FAQ]]
+
[[Category:Version 1.5 FAQ]]</noinclude>

Revision as of 16:26, 1 September 2012

Most PHP files within Joomla! 1.5 begin with the following statement:

defined('_JEXEC') or die('Restricted access');

This statement checks to see if the file is being called from within a Joomla! session. This protects your site by making it more difficult for a cracker/hacker to damage your site.

However, this line should NOT be included in your main index.php file, since this is the program that starts the Joomla! session.