src absolute path problem

luca picture luca · Mar 1, 2011 · Viewed 166.2k times · Source

I have an image in C:\wamp\www\site\img and i try to display it in a page with this:

<img src="C:\wamp\www\site\img\mypicture.jpg"/>

but it's not working.The file is actually there and if I try to refer to it with a relative path i got the picture

<img src="../img/mypicture.jpg">

where is the error?what am I missing?? thank you again guys!

Answer

rlb.usa picture rlb.usa · Mar 1, 2011

You should be referencing it as localhost. Like this:

<img src="http:\\localhost\site\img\mypicture.jpg"/>