Re: Document root, preferred way to find it???

From: Date: Tue, 08 Mar 2005 10:30:19 +0000
Subject: Re: Document root, preferred way to find it???
References: 1 2 3 4 5 6 7  Groups: php.general 
Request: Send a blank email to php-general+get-210209@lists.php.net to get a copy of this message
Leif Gregory wrote:
Hello Marek, Sunday, March 6, 2005, 7:08:24 PM, you wrote:
I don't see where that tells me where the include folder would be.
MK> If you know how the files are layed out in your application, you do. No... You missed the point of this whole thread which was explained in point 1 and point 2 of the "Problem" section. Restated in different words is how do you write some code which is dynamic enough to withstand reorganization of folders either on the same host, a different host (maybe with a different OS too), or a mixture of any. In HTML, a css declaration as follows: <link rel="stylesheet" type="text/css" title="Site CSS" href="includes/site.css" />
er does it really? <link rel="stylesheet" type="text/css" title="Site CSS" href="includes/site.css" /> I'm pretty sure the url is ./includes/site.css i.e. the include subdir of the dir in which the html file that includes the link tag is in. if you move the html file up or down a dir then the link to the css file will break.... maybe browsers are smart enough to also check /includes/site.css
works regardless of where the page is, where it's moved to, and regardless of how many folders down it is as long as there is indeed a folder off the site root called "includes" and as long as there is a file in that folder called "site.css". How do we mimic that capability in PHP so pages don't have to be re-written if point 1 or point 2 of the "Problem" are met? Cheers, Leif Gregory


« previous php.general (#210209) next »