

There has to be some hard and fast conventions for dealing with url paths.

the problem:

suppose you write $root/$path

depending on the values of $root and $path, you might end up with:

//path or root/path or root//path or root/ or root//

the first option, //path is REALLY BAD because web browsers think this is
domain name. the others are ugly, but will be understood by the browser.

so, the convention:


ROOT

root variables must either be empty or start with a /. They may not end in a
slash.

PATH

path variables can be empty or in the form "path/to/something". They should end
in a slash if the path is to a directory. it should start with a / if and
only if this path is absolute (in regards to our site root).

SO:

there are two correct ways of specifying a path:

$root$path if the path starts with a /

$path if the path does not start with a /

the function link() should handle this for you.

