Re: [PHP] Specifying Variable Document Path in PHP
On Tuesday 26 October 2004 04:46, Anthony Baker wrote: > 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? Have a look at: print_r($_SERVER); and find something that is unique (to each server) that you can use. $_SERVER['HTTP_HOST'] is usually a good candidate. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I know it all. I just can't remember it all at once. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Specifying Variable Document Path in PHP
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