On some of my php-pages I want to show external images, and I get the src-address from a mySQL db, but the images are broken. What have I done wrong? The head-tags are where they should be.
Thanks in advance!
Best regards, Daniel Oberg
If you are hot-linking to images on someone elses server....DON'T. They probably check the REFERER and don't allow you retrieve the images.
--Rich
It's mostly users' own pictures located on their own webspace.
/Daniel
How are you trying to show them on your page?
somthing like this:
$funky = mysql_query("SELECT... list($image)=mysql_fetch_row($funky); <IMG SRC=\"$image\">
Thanks!
Make sure that "http://" is before the image variable or it is in the variable already, otherwise it looks for it on your own server at the weird address. You may have already known that
Are you using "echo()" or "print()" to output the "<IMG>" tag to the browser?
I'm using echo "<IMG SRC=\"$image\">";
Yes, there's nothing wrong with the address, when I copy the address from the properties of the image (right click) and visit it, the images is there.
Well, since you are echoing a standard HTML tag, it is up to the browser to retrieve the image off of the remote site. You will have to view your own page, then do a "view source" in your browser and look at the "<IMG>" tag that the browser actually sees. Post that here so we can see what's wrong with it.
-- Rich