Re: avoid server folder reading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 19, 2008 12:57 PM, Alain Roger <raf.news@xxxxxxxxx> 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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux