Re: Absolute or relative paths
- From: "elektrophyte" <elektrophyte@xxxxxxxxx>
- Date: 10 Jul 2005 13:26:22 -0700
Within plain HTML if you start a URL with "/" that refers to the root
level of the domain and your absolute URL will be good. For example,
<img src="/images/myFile.gif" />
should work no matter where it's used.
However everything's different within PHP code. If want to refer to an
absolute path inside of <? and ?> then you need to use a different
strategy. One thing that works is to precede your absolute path with
"$_SERVER['DOCUMENT_ROOT'] like this:
<? include($_SERVER['DOCUMENT_ROOT'] . '/include/navbar.inc'); ?>
.
- References:
- Absolute or relative paths
- From: michelle
- Re: Absolute or relative paths
- From: John Dunlop
- Absolute or relative paths
- Prev by Date: call_user_func() vs. "variable functions"
- Next by Date: Re: How to encrypt URL Address ?
- Previous by thread: Re: Absolute or relative paths
- Next by thread: Re: Absolute or relative paths
- Index(es):
Relevant Pages
|