tags:

views:

49

answers:

6

Hey everyone,

I have the following line to display an image:

$output .= '<div><img src="C:/backup/images/000001_full.jpg"></div>';

($output is then put into an html file as a local backup). When I view the page with IE, the image is displayed fine, but not with firefox. Any idea why?

Thanks,

Dave

+6  A: 

I think you want:

$output .= '<div><img src="file://c:/backup/images/000001_full.jpg"></div>';

Neurofluxation
Thanks! that got it working!
David Menard
A: 

Maybe because your src is not valid urlfor Firefox.
Have you tried file://c:/backup/images/000001_full.jpg ?

Marks
A: 

You need to close your img tag. So,

$output .= '<div><img src="C:/backup/images/000001_full.jpg" /></div>';

IE likes to play it kind of loose with HTML specs, but Firefox pays more attention to the standards.

fire.eagle
A: 

Why are you using a link to the file system location? The image should be part of the site, and should be linked to as a relative URL such as \images\000001_full.jpg.

Dante
+1 for using a relative path instead of an absolute path.
Jacob Ewald
its to make a local backup of the site. Notice how the image is in C:/backup
David Menard
A: 

use relative path. i am also not sure but Something like $output .= '<div><img src="../images/000001_full.jpg"/></div>'

Amit Ranjan
A: 

I reproduced this problem. The image displays in IE (and Chrome), but not in Firefox. The reason is because local files can't be accessed directly. Prefix the src tag with file:/// and it will work just fine as in:

$output .= '<div><img src="file:///C:/backup/images/000001_full.jpg"></div>';
grammar31