On Mon, 6 Jul 2009 16:16:55 -0600
Govinda <govinda.webdnat...@gmail.com> wrote:

> I do not really understand why
> should return the right data at one time and not at another.  (?)

In general it will always provide the right data, but as the manual
says: "The entries in this array ($_SERVER) are created by the web
server. There is no guarantee that every web server will provide any of
these; servers may omit some."

The problem could arise if the script is transfered unto a web server
where the $_SERVER array (or parts of it - in this case the
document_root part) has been disabled.

Take into consideration where the script/program has to run and whether
it is likely to be moved around to different web servers with different

> Also, what is the difference between a path that starts with "/",  
> versus the same path but that does not have that leading "/", or
> that same path but prefixed with "./"?
> I.e., this:
> /somepath/includes/file.php

This depends on whether the web server is running in a chroot.

If the web server for example has access to all files on the machine
and isn't running in any kind of chroot or limited setup, then
"/somepath" is located in the very root of the directory on that
particular hard drive (or partition) and "/somepath" is NOT a sub
directory of another directory.

So you would see something like this (if you are not using Windows):


> versus this:
> somepath/includes/file.php

This depends on where your script is running from. 

If your script is running in: 

Then the above would become:

If your script is running in: 

Then the above would become:

> versus this:
> ./somepath/includes/file.php

Its the same as "somepath/includes/file.php" a "./" means "current
working directory".

I hope I make sense.

If you haven't already take a look at:

> ("../" I know)
> -G

Mange venlige hilsner/Best regards

Kim Naim Lesmer
Programmer/Unix systemadministrator

Web    : www.bitflop.com
E-mail : k...@bitflop.com

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to