Re: include() problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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.
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux