You're missing something simple, I think.

/*  Use these variables in each of the pages you need them, or stick them in
a config include */
$files_above_root = "/home/pages/www";
$files_below_root = "/home/pages";

/* reference includes similar to this method */
include("$files_above_root/somethingallshouldsee.php");

include($files_below_root/secret.inc");
or in another subdirectory below the www root:
include("$files_below_root/secret_files/topsecret.inc");

Zap.  That should do it :)

James.

> I can use "$DOCUMENT_ROOT/includes/" to refer to my includes folder if it
> is at the top of my web directory. This works consistently no matter where
> about in the site I call it from.
>
> Is there a similar easy way to refer to a folder that is placed outside
the
> web tree (above the web directory) for security? The only way I seem able
> to do it is using "../../../includes/", for example, which naturally
> depends on how deep in the website I am.
>
> FTFM me if I have missed something built in and obvious.
>
>
> Andy Clarke
>
>
>
>
>  ------------------------------------------------
>                    Andy Clarke
>       78 West Kensington Court, Edith Villas,
>              London, England  W14 9AB
>
>             phone:  44 (0)20 7602 3382
>               mobile:  07947 418177
>
>           Freelance Lingo/PHP Programmer
>
>                  [EMAIL PROTECTED]
>  ------------------------------------------------
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to