tags:

views:

40

answers:

3

i have problem firefox does not support long path but in IE code run smoothly.

<img src="C:/Program Files/EasyPHP-5.3.2i/www/Place4Info/Images/Skin_Tone/light.JPG" width= "50" height="30"/>

this is the path. if i use short path then it work in firefox but if i use above path then it didnt show image.

but it show image in IE.

plz give me suggestion.

+8  A: 

Try to use relative addressing rather than absolute addressing.

Asuming you have no other choice, use this file:/// in front of the addresses.

<img src="file:///C:/Program Files/EasyPHP-5.3.2i/www/Place4Info/Images/Skin_Tone/light.JPG" width= "50" height="30"/>
Hamid Nazari
You were slightly faster...
Jasper
after completing my project i will upload this website to webhost,that time how i give path.
Pratikg88
it still didnt work
Pratikg88
@Pratikg88 have a look at this article http://www.coffeecup.com/help/articles/absolute-vs-relative-pathslinks/
Hamid Nazari
hey thanks dude.
Pratikg88
+3  A: 

Full paths (that's what you are calling a long path) should include a protocol: add file:/// to the beginning of the path

Jasper
exactly. That it works in IE is a bug.
seanizer
Or a "feature". No seriously, it was probably intentional (and makes sense from a Microsoft point of view), so calling it a bug is not the full truth. Still, it can be confusing, is non-standard and really shouldn't be that way.
Jasper
+2  A: 

Referencing an image from a local file

You need to upload your picture from a publically available source (probably the web!) It looks like you have uploaded it, but you probably should be referencing it relatively, for example something like:

<img src="Images/Skin_Tone/light.JPG" width= "50" height="30"/>

(Modify path as necessary)

Getting mixed up with client/server side

PHP has nothing to do with firefox or internet explorer or any other browser. It is server side, and you are referncing a client side problem.

Tom Gullen
At times using a local file is what you want. Not too often, but it does happen. The comment about php is a good one.
Jasper