Re: include() problem

From: Date: Mon, 09 Jan 2006 18:59:53 +0000
Subject: Re: include() problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-228353@lists.php.net to get a copy of this message
Here's a snippet of what's at the start of most of my php files: $pagetitle = "Lily Articles"; $pagefname = __FILE__; // for later logging $pagedocroot = $_SERVER['DOCUMENT_ROOT']; require_once ("$pagedocroot/include_db/db_connect.php"); require_once ("$pagedocroot/include/funcs.php"); Hope that helps. Gerry On 1/9/06, Nuno Trancoso <erazerpt@gmail.com> wrote: > > This may sound dumb, but i have been up all night going through > php/apache docs, and still have not found an answer.. > > Throughout a site i need to include files that are scattered in subdirs, > sometimes up in the dir tree, sometimes down. Bad design i know but i > have to live w/ it... > > Problem is in the way Apache/PHP see stuff. If i include /somefile.htm > in html, it means somefile.htm wich is at site root dir. In PHP it looks > like it means somefile.htm at SERVER root dir. >

« previous php.general (#228353) next »