Re: Quick Directory Question

From: Date: Thu, 08 Feb 2001 19:16:06 +0000
Subject: Re: Quick Directory Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38802@lists.php.net to get a copy of this message
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 > > andy@kinonet.com > ------------------------------------------------ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#38802) next »