Re: Specifying Variable Document Path in PHP

From: Date: Tue, 26 Oct 2004 13:04:59 +0000
Subject: Re: Specifying Variable Document Path in PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-200320@lists.php.net to get a copy of this message
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. */

« previous php.general (#200320) next »