note 34501 deleted from function.header by didou
| From: | didou@php.net | Date: | Tue, 29 Jul 2003 12:19:40 +0000 |
| Subject: | note 34501 deleted from function.header by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-52924@lists.php.net to get a copy of this message | ||
Note Submitter: mina86@tlen.pl
----
In respons to: sahasrahla (05-Jun-2003 12:17)
There's simpler way of preventing user to access files which he shouldn't. At the begining
of index.php put:
<?php define('IN_PHP_SCRIPT', true); ?>
and then at the begining of each file included in index.php put:
<?php if (!defined('IN_PHP_SCRIPT')) die('Hacking attempt.'); ?>
or if you prefer:
<?php
if (!defined('IN_PHP_SCRIPT')) {
header('Location: http://www.server.com/');
exit;
}
?>