> echo '<pre>', var_dump( $_SERVER ), '</pre>';
>
> for instance I cut/paste the following from an application of my,
> the code lives in a centrally included file:
>
> /* define a webroot basepath for the datasyncer module */
> define('DS_WEBROOT', realpath(dirname(__FILE__).'/..'));
>

dirname! That's the easiest way.

$tmpdir=dirname(__FILE__)."\\temp";

Thanks for your help

> > The problem I have is that this path is set in the config section of a
3rd
> > party tool I'm using, and called from various pages within the site. I
don't
> > want to hack the code, as that will make upgrades more difficult to
apply.
> > Hard-coding the path from c: won't work well either, as that path is
> > different in the development and live environments.
>
> if the path is set in the third party tool whats the problem? sorry don't
mean to
> rude - I really don't quite follow the last part of your post!
>


No, it doesn't make much sense, does it? One more try: the 3rd party app has
a config script (config.php), where this path is set. It will be accessed
from scripts in various different directories, so the path needs to be
absolute. And therefore, it needs to be set dynamically so it can work on
different machines.

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

Reply via email to