Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best Practice for "img src=" - URL Vs. Filesystem?

Status
Not open for further replies.

gwillr

IS-IT--Management
Nov 4, 2003
267
CA
Just a general question for inserting images to a page:

which is better/what are the benefits and drawbacks to inserting images via each of the following ways?

Filesystem of my server:

<img src="frontimages/mailtop.gif">

OR is it better to use the URL to the image on the server:

<img src="
What is the best for performance? Security? -or does it not really make any difference whatsoever?

Thanks in advance for all of your responses.

Gary
 
It makes not difference really, both are interpreted as the same full URL request, and anybody knows that the *non-full-URL* type will come off your server anyway ...
 
the main difference is that if you include the complete URL rather than a relative one you'll have a heck of a time if you ever move the code from one machine to another.
You'll have to rewrite all your html to use the different URLs of the new server.
 
jwenting :

<tongue-in-cheek>
Isn't that what "search and replace" is for ???!!!
</tongue-in-cheek>
 
yes, but wouldn't you rather not have to touch the files at all?
Plus of course search and replace over multiple files, likely in multiple locations, is notoriously error-prone.
You ALWAYS forget at least one ;-)
 

>> search and replace over multiple files, likely in multiple locations, is notoriously error-prone.

The operation is only as error prone as the person behind the keyboard at the time.

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top