Can someone here give me a script that curl's image from another domain.
If the get request is PNG, then it outputs it as PNG header.. If it's JPG, it outputs it as JPG Header...
It only has to work with images, with extensions png/gif/jpg
^ Example this would echo image/png automaticly as the url is png header.. it wouldnt accept php files, html or output anything but images ? lol
If the get request is PNG, then it outputs it as PNG header.. If it's JPG, it outputs it as JPG Header...
It only has to work with images, with extensions png/gif/jpg
PHP Code
<?php
$ch = curl_init ("http://www.google.com/images/logos/ps_logo2.png");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
$image = curl_exec($ch);
curl_close ($ch);
header("Content-Type: image/png");
echo $image;
?>