Re: Website Architecture
| From: | Stuart | Date: | Thu, 05 Feb 2004 21:48:22 +0000 |
| Subject: | Re: Website Architecture | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-176942@lists.php.net to get a copy of this message | ||
Eric Gorr wrote:
A solution I found was in dirA/index.php, to chdir( ".." ); before the require_once, which moves the current directory to SiteRootDir and allows otherfuncs.php to be found ... is this the best way to solve this problem?Qualify relative paths by prepending $_SERVER['DOCUMENT_ROOT'].'/' - I usually define a constant at the start of all scripts like so... define('SITE_ROOT', $_SERVER['DOCUMENT_ROOT'].'/');
forming a relative URL. Again, this would point to a different location depending on whether dirA/index.php or SiteRootDir/index.php called the function containing this relative URL and I want them to point to the same location.Why can't you specify an absolute URL?
Thank you.You're welcome. -- Stuart