Reply to Re: [PHP] Document root, preferred way to find it???

Your name:

Reply:


Posted by Jochem Maas on 03/08/05 12:30

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
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация