PHP No direct access allowed Posted byProsoxi.com Webmaster April 14, 2011 1 Comment on PHP No direct access allowed <?php if (__FILE__ == $_SERVER[‘SCRIPT_FILENAME’]) exit(‘No direct access allowed.’);?> <?php if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) exit('No direct access allowed.'); ?>
if (realpath(__FILE__) == realpath($_SERVER[‘SCRIPT_FILENAME’])) {
exit;
}