NYCPHP Meetup

NYPHP.org

[nycphp-talk] Include file questions

Daniel Convissor danielc at analysisandsolutions.com
Sat Feb 14 13:11:30 EST 2004


On Sat, Feb 14, 2004 at 12:54:16PM -0500, leam wrote:
> 
>   $DOCDIR = explode("/", "$_SERVER[DOCUMENT_ROOT]");
>   array_pop($DOCDIR);
>   array_push($DOCDIR, "php");
>   $PHPDIR = implode("/" , $DOCDIR );
> 
>   include("$PHPDIR/common_html.inc");

That's pretty convoluted.  Here's what I do.

if (getenv('HTTP_HOST') == 'localhost') {
    require '/development/location';
} else {
    require '/isp/location';
}

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list