Hi,
It seems that your server is not able to open connections to the outside.
Probably a hosting issue.
In that case, remove the whole:
$fp = fsockopen($query, 80, $errno, $errstr, 5);
if ($fp) {
$out = "GET " . $query .
"Connection: Close\r\n\r\n";
fputs($fp, $out);
while (!feof($fp)) {
$return .= fgets($fp, 128);
}
fclose($fp);
}
?>
and add instead:
?><img src="<?php echo $query; ?>" />
and use https:// in the query, not ssl://
That way, it will be the browser of the customer which will call the URL and it should work fine.