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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to