Re: avoid server folder reading
| From: | Nathan Nobbe | Date: | Sat, 19 Jan 2008 18:02:22 +0000 |
| Subject: | Re: avoid server folder reading | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-267651@lists.php.net to get a copy of this message | ||
On Jan 19, 2008 12:57 PM, Alain Roger <raf.news@gmail.com> wrote:
> Hi,
>
> I would like to know how to avoid (using PHP code) any user to read the
> content of my website folder ?
> as my website is hosted by and external company, i do not have access to
> apache conf file.
you could take the code igniter approach.
have a script, like config.php, that has a constant; anything, like
define('IM_ALIVE', true);
then, require that all your scripts must have this file included, first
thing.
and at that point you can do something like this:
if(!defined('IM_ALIVE')) { die('no direct access to scripts allowed!'); }
-nathan