"Tyler Replogle" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hey,
> i didn't quite get when you ment by that but have you tried using
> $DOCUMENT_ROOT before your path, that might help it will be something like
> this
> require_once('$DOCUMENT_ROOT/test/db.php');
> $DOCUMENT_ROOT  goes to your first folder that shows up online (where your
> index page is)

Use the Server array variable instead (the brackets can be omitted):

require_once $_SERVER['DOCUMENT_ROOT'] . '/test/db.php';

Regards,
Torsten

>
>
> >From: "Sheeraz fazal" <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: [PHP] require_once('') relative path problem
> >Date: Thu, 22 Apr 2004 14:34:23 -0600
> >
> >Hi,
> >I have problem in undertanding the
> >require_once/require/include/include_once
> >functionality. Php files in my project are located in different folders.
> >Some folders have common files for other files. And file layout is like
> >this
> >
> >/*
> >     File: a.php
> >*/
> >require_once('../test/db.php');
> >...
> >
> >
> >/*
> >File: db.php
> >*/
> >require_once('../globals/global.php');
> >...
> >
> >
> >when i include a.php in another file i get error for global.php file that
> >path could not be found. And if i correct the path in db.php then
someother
> >file which is using db.php will get error. So, can someone elaborate that
> >how relative path works in require_once. what is the starting directory
for
> >require_once function which is using relative path.
> >
> >Or
> >
> >Is there any way that i can included some constant which include the
> >absolute path from which all relative paths can be determined?
> >
> >Comments welcome.
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> _________________________________________________________________
> Lose those love handles! MSN Fitness shows you two moves to slim your
waist.
>
http://fitness.msn.com/articles/feeds/article.aspx?dept=exercise&article=et_
pv_030104_lovehandles

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to