[PHP] Setting or Getting Relative Path for PHP Includes

2004-12-20 Thread Anthony Baker
Hey Folks,
Hoping someone can aid me with a newbie-ish question.
I often use PHP includes in my files to pull in assets, but I hard code 
the relative path to the root html directory for the sites that I'm 
working on in each file. Example below:


I'd like to be able to set the relative path as a global variable from 
an external file so that I can modify one line of code to change the 
relative path across the site. This will allow me for easier coding in 
staging and development environments.

What's the best way to do so? Can anyone provide a code example?
Either that, or is there a way to call this variable from the server 
itself so that it's automatically -- and correctly -- set?

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


[PHP] Specifying Variable Document Path in PHP

2004-10-25 Thread Anthony Baker

Hey Folks,

My first post to this list and forgive me if this is ground that's been trod
before, but this has been bugging me for a bit.

I'm developing a site that's going to be running on a staging environment
and a production environment. Have a number of PHP includes in the
production site that specifically call the file pathname (thus):




The problem here is that the path will vary slightly depending on whether
it's the staging server or production server. I'd ideally like to set a
single global variable that can handle this so I don't have to hard-code
paths across the site (as I'm doing now).

Is there any easy way to accomplish this?


Thanks in advance,

Anthony

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