Re: Absolute or relative paths
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Absolute or relative paths

From: John Dunlop <usenet+2004@john.dunlop.name>
Date: Sat Jul 09 2005 - 20:42:30 CEST

michelle wrote:

> Is there a way to use an absolute path that always refers to the
> website's root directory...or do I need to use a relative path?

Aye.

> The problem I am having is how to refer to my "/images" directory no
> matter where it is referenced in the website's directory structure.

Probably /images/ (note the trailing slash).

> I have used the URI (http://www.mysite.com/images), but that seems too
> complex,

I'd imagine it has other side effects too.

> I know that PHP must have a simpler solution.

To refer to the URI

  http://domain.invalid/images/

with a base URI of

  http://domain.invalid/foo/

either <../images/> or </images/>; the latter works regardless
of base URI.

-- 
Jock
Received on Mon Oct 17 21:04:36 2005