Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Digital Lifestyle
Web Design and Hosting
Re: Displaying graphics
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Murlyn" data-source="post: 5887" data-attributes="member: 184"><p>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:</p><p></p><p>/public_html/forums/macforum/webdesign/</p><p></p><p>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:</p><p></p><p>1) <img src="http://www.example.com/forums/macforum/images/test.gif" /></p><p>This is an absolute link</p><p></p><p>2) <img src="../images/test.gif" /></p><p>This is a relative link</p><p></p><p>3) <img src="/forums/macforum/images/test.gif" /></p><p>This also is a relative link</p><p></p><p>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.</p><p></p><p>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.</p><p></p><p>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</p><p></p><p>Cheers!</p></blockquote><p></p>
[QUOTE="Murlyn, post: 5887, member: 184"] 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: /public_html/forums/macforum/webdesign/ 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 Cheers! [/QUOTE]
Verification
What is Apple's smallest desktop computer called?
Post reply
Forums
Digital Lifestyle
Web Design and Hosting
Re: Displaying graphics
Top