Actions

Difference between revisions of "Restricted access"

From Joomla! Documentation

(New page: {{cookiejar}})
 
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
{{cookiejar}}
+
Most PHP files within Joomla! begin with the following statement:
 +
 
 +
<source lang="php">
 +
// no direct access
 +
defined( '_JEXEC' ) or die( 'Restricted access' );
 +
</source>
 +
 
 +
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.
 +
 
 +
Code for 1.0 extensions<source
 +
<source lang="php">
 +
// no direct access
 +
defined( '_VALID_MOS' ) or die( 'Restricted access' );
 +
</source>
 +
 
 +
 
 +
 
 +
[[Category:JED]]

Latest revision as of 16:47, 7 August 2010

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

// no direct access
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.

Code for 1.0 extensions
// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );