note 13612 deleted from function.require by sniper

From: Date: Sat, 18 Jan 2003 15:29:07 +0000
Subject: note 13612 deleted from function.require by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-42353@lists.php.net to get a copy of this message
Hi, thanks for your tips about require()ing with $DOCUMENT_ROOT. In vivo this runs well (my provider uses Apache and PHP3/4), but I had problems in vitro (means at home) where I run Win2k, IIS 5 & PHP4.0.5. I was surprised to find out that IIS doesn't set $DOCUMENT_ROOT! The following workaround achieves pleasant results: <code> if ( strlen($DOCUMENT_ROOT) == 0) $DOCUMENT_ROOT = 'F:/MyWebs/annwn'; require_once($DOCUMENT_ROOT . '/inc/TTextField.class.php4'); </code> If $DOCUMENT_ROOT is not set I'll set it to the physical path to my site on the server, otherwise (e.g. when published) I leave it alone.

« previous php.notes (#42353) next »