Here is a version that just displays the image, and doesn't save it, to save server space
PHP Code:
<?php
function curlHeaderCallback($query, $header){
global $mime;
if(stripos($header, "content-type")!==false){
header(trim($header));
}
return strlen($header);
}
$image = $_GET['img'];
$query = curl_init($image);
curl_setopt($query, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9");
curl_setopt($query, CURLOPT_CONNECTTIMEOUT ,0);
curl_setopt($query, CURLOPT_TIMEOUT, 10);
curl_setopt($query, CURLOPT_HEADERFUNCTION, 'curlHeaderCallback');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
$ret = curl_exec($query);
echo $ret;