If Image Exists - how does it work cross-domain ?
Posted: Thu Jul 03, 2014 7:53 am
Code: Select all
$thumbnail="http://www.site.co.uk/images/productphotos/small/$row->photoprimary";
if(file_exists($thumbnail))
{
echo "<img src='http://www.site.co.uk/images/productphotos/small/$row->photoprimary' border='0' style='border: 1px solid #000000'/>";
}
else
{
echo "<img src='/images/blank.gif' border='0' width='142px' style='border: 1px solid #000000'/>";
} However, there have been times when images are not on the other site for whatever reason. It thinks they are, so we get the 'x' box on the browser.
So I am trying to use the script above to query if the file exists - but it doesn't work. I think it's because of the way I am using $thumbnail as the target.
Where am I going wrong please?