This is extremely unfortunate as I don't know of a way to do this either. I
do however have a workaround that's not too tedious.

Insert the following code into the very top of all of your documents:

$GLOBALS["DOCUMENT_ROOT"] =
preg_replace("/wwwroot.*$/i","wwwroot",$PATH_TRANSLATED);

This assumes that your root web folder is wwwroot. Change this as necessary.
This enables you to include files like so:

include_once($DOCUMENT_ROOT."/includes/main_header.inc.php");

By the way, $DOCUMENT_ROOT is an Apache environment variable so if you
happen to be running Apache instead of IIS just leave out the preg_replace
call because $DOCUMENT_ROOT will already be set for you.

--Toby



----- Original Message -----
From: "Olivier Botineau" <[EMAIL PROTECTED]>
To: "PHP Windows list (Adresse de messagerie)" <[EMAIL PROTECTED]>
Sent: Friday, April 20, 2001 6:05 PM
Subject: [PHP-WIN] include


> Good evening all,
> do you know if its possible to give an absolute path instead of a relative
path for include:
> include( '../../menu.php' ); is OK
> incude( '/inculde/menu.php' ); is Not OK
>
> Depend where im in tree directory i have to change '../', then relative
path
> is not usefull in that case.
> (ASP allows this in include directive with VIRTUAL parameter, so I suppose
> PHP too?)
> Olivier.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to