Re: include() and paths

From: Date: Fri, 01 Mar 2002 11:48:27 +0000
Subject: Re: include() and paths
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-86752@lists.php.net to get a copy of this message
Hi Nick, > masterfile.inc lives in /var/www/includes/ and contains this line: > include("/var/www/includes/anotherfile.inc"); > > in index.php I include masterfile.inc and thus get anotherfile.inc. > > What I'd like to know though is, is it possible to have the include line > in masterfile.inc specify a url *relative* to itself? > like: > // masterfile.inc > include("anotherfile.inc"); // now the path is relative. AFAIK the options are absolute addressing, relative addressing (to the php.ini), and http access. RTFM the four pages from http://www.php.net/manual/en/function.require.php. There's quite a bit of advice/experience in the user annotations! Regards, =dn

« previous php.general (#86752) next »