I had a script to download it but the problem was that I couldn't get it to work so I'm sure it is possible.
img is a variable with a url to the image.
The problem is that I can't get it to work because I don't understand a thing about it.
if (isset($_GET['img'])){
$img = urldecode($_GET['img']);
$img = substr(urldecode($_GET['img']), 18);
$header = "GET $img HTTP/1.0\r\n";
$header .= "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\r\n";
$header .= "Accept: text/html, image/png, image/x-xbitmap, image/gif, image/jpeg, */*\r\n";
$header .= "Accept-Language: en\r\n";
$header .= "Accept-Encoding: deflate, identity, chunked;q=0, *;q=0\r\n";
$header .= "Referer: [url]http://us.imdb.com/\r\n[/url]";
$header .= "Host: ia.imdb.com:80\r\n";
$header .= "Cache-Control: no-cache\r\n";
$header .= "\r\n";
$fp = fsockopen('ia.imdb.com','80');
if (!$fp) {
die('Error connecting to ia.imdb.com:80 ('.$url.')');
}
fputs($fp, $header);
echo "|$fp|";
/* we only want the image, so skip past the header */
$dummy = '';
while(!feof($fp) && $dummy != "\r\n"){
$dummy = fgets($fp, 256);
}
/* get the image itself*/
$pic = '';
while(!feof($fp)) {
$pic .= fread($fp, 1024);
}
fclose ($fp);
/* accept gzipped html, as accepted by the sent headers */
if(strpos($pic, 'Content-Encoding: gzip') > 0){
$pos = strpos($pic, "\r\n\r\n");
$pic= gzinflate(substr($pic, $pos));
}
header('Content-type: image/jpeg');
echo substr($pic, strpos($pic, "\r\n\r\n"));
}
I hope someone can explain it to me in short