Re: webserver root

From: Date: Mon, 10 Sep 2001 11:33:58 +0000
Subject: Re: webserver root
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-9285@lists.php.net to get a copy of this message
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: michel@systemtech.se WWW: http://www.systemtech.se

« previous php.windows (#9285) next »