Add this to the page that you want to only be included
<?php
if(!defined('MyConst')) {
die('Direct access not permitted');
}
?>
then on the pages that include it add
<?php
define('MyConst', TRUE);
?>
More Related Contents:
- include php file in javascript [closed]
- unwanted (text) after using include
- “Fatal error: Cannot redeclare “
- Are PHP include paths relative to the file or the calling code?
- Difference between “include” and “require” in php
- including a remote file in PHP
- How does the keyword “use” work in PHP and can I import classes with it?
- How to include() all PHP files from a directory?
- including php file from another server with php
- Get absolute path of initially run script
- How to include WordPress functions in custom .php file?
- PHP: Check if a file is loaded directly instead of including?
- PHP – include a php file and also send query parameters
- Passing a variable from one php include file to another: global vs. not
- include, include_once, require or require_once?
- Equivalent of include() in HTML
- PHP include best practices question
- Get filename of file which ran PHP include
- How to use include within a function?
- Process HTML files like PHP
- Warning: require_once(): http:// wrapper is disabled in the server configuration by allow_url_include=0
- PHP pass variable to include
- What does the dot-slash do to PHP include calls?
- How to make Apache serve index.php instead of index.html?
- PHP include absolute path
- How to include file outside document root?
- PHP include(): File size & performance
- PHP Include for HTML?
- Include PHP file into HTML file [duplicate]
- Include: CSS with .php file extension?