07-11-2003, 01:41 PM
Originally Posted by meerk
Not quite true unfortunately. You need to put in a couple of 'dots' before the first 'forward slash'
eg (from your code)
…this should be
This is assuming that both the 'page' and 'images' folders are in the same directory.
Hope this helps
Actually a couple dots with a forward slash ../ means go back one directory, it does not mean go back to the web root.. so for instance if your directory structure was like this:
And you had an html document within the webdesign directory and you wanted to access an images directory within the macforum directory you could make your link three ways:
1) <img src="http://www.example.com/forums/macforum/images/test.gif" />
This is an absolute link
2) <img src="../images/test.gif" />
This is a relative link
3) <img src="/forums/macforum/images/test.gif" />
This also is a relative link
The first one takes the absolute link, finds the server, even though it's localhost and outputs your image.. this actually takes more time since it has to do a dns lookup, etc etc on the domain name.
The second knows that it is on the same server so does not have to do a dns lookup. and it says.. go back one directory "macforum" then within the "macforum" directory go into the "images" folder.. now if your images folder was in the "forums" directory you could do this <img src="../../images/test.gif" /> which means go back two directories then go into the images directory.
The third by using the first slash to go to the web server root, not the machine root this is done by the server software to prevent people from surfing through your file structure, then it says go to the macforum directory, then the images directory then show test.gif