Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $_SERVER['SCRIPT_FILENAME']
- .htaccess
- php.ini
- php.ini
- $parentPath = dirname(dirname(__FILE__));
- $ourPath = $parentPath . DIRECTORY_SEPARATOR . 'include';
- $includePath = ini_get('include_path');
- $includePaths = explode(PATH_SEPARATOR, $includePath);
- // Put our path between 'current directory' and rest of search path
- if ($includePaths[0] == '.') {
- array_shift($includePaths);
- }
- array_unshift($includePaths, '.', $ourPath);
- $includePath = implode(PATH_SEPARATOR, $includePaths);
- ini_set('include_path', $includePath);
- $parentPath = dirname(dirname(__FILE__));
- $ourPath = $parentPath . DIRECTORY_SEPARATOR . 'include';
- $includePath = ini_get('include_path');
- $includePaths = explode(PATH_SEPARATOR, $includePath);
- // Put our path between 'current directory' and rest of search path
- if ($includePaths[0] == '.') {
- array_shift($includePaths);
- }
- array_unshift($includePaths, '.', $ourPath);
- $includePath = implode(PATH_SEPARATOR, $includePaths);
- ini_set('include_path', $includePath);
- <?php
- if (!eregi("modules.php", $PHP_SELF)) {
- die ("You can't access this file directly...");
- }
- // more code ...
- ?>
- if(!isset($in_prog)){
- exit;
- }
- // index.php
- require_once 'includes.php';
- // includes.php
- define('IN_MY_PROJECT', true);
- include 'myInc.php';
- // myInc.php
- defined('IN_MY_PROJECT') || die("No direct access, plsktnxbai");
Add Comment
Please, Sign In to add comment