Can't you just use include("filename.php") for the webroot...
...and use include("..\pages\filename.php") for subdirs?

Assumed that you set the webroot in PHP .ini and change forward/backward slash
depending on what OS you use.

Mitja Pagon wrote:

> Hi!
>
> I'm am an ASP developer, that decided to give PHP a try. So far I have been
> nothing but impresed by PHP. But I have found one problem, that i can't find
> a solution to.
> When including files in ASP pages using <!--#virtual="/filename.asp"--> I
> was able to include files into pages using path relative to the webserver
> root. I have tried similar in PHP using include("/filename.php"), but just
> recently learned that "/" slash charachter moves the pointer to the root of
> the drive on which webserver directory is located on. I'm running PHP 4.0.6
> on WinNT with IIS4.0, therefor $DOCUMENT_ROOT variable doesn't work. I'm
> writing an application that should be portable not just from server to
> server, but also from platform to platform, so I can't have fixed paths in
> my scripts.
> My question is: "Is there any way I can get the root of the webserver in a
> fashion simmilar to that of the method ASP uses?"
>
> Thanks,
>
> Mitja Pagon

--

Michel Laine
Engineer / Network Administrator

SYSTEM TECHNOLOGY SWEDEN AB
Phone:(+46)-8-982255
Fax:(+46)-8-982060
Snail mail: Vretenvagen 2,  171 54 SOLNA,  SWEDEN

E-mail: [EMAIL PROTECTED]
WWW: http://www.systemtech.se



-- 
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