Specifying Variable Document Path in PHP
| From: | Anthony Baker | Date: | Tue, 26 Oct 2004 04:46:24 +0000 |
| Subject: | Specifying Variable Document Path in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-200318@lists.php.net to get a copy of this message | ||
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):
<?php include '/home/production_site/public_html/pagename.php' ?>
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