
23-02-2011, 13:07:12
|
| |
Imageshack.us Sorunsalı - Çözümü [PHP] | | HTML-Kodu: [B]Kullanımı:[/B] PHP- Kodu: http://localhost/ozge.php?resim=http://img155.imageshack.us/img155/1479/frusm6a6232ffg5.jpg
PHP- Kodu: <?php
$resim = $_GET['resim'];
$path = pathinfo($resim);
if($path['extension'] == 'jpg' || $path['extension'] == 'jpeg') $ext = 'jpeg';
elseif($path['extension'] == 'bmp') $ext = 'wbmp';
elseif($path['extension'] == 'png') $ext = 'png';
elseif($path['extension'] == 'gif') $ext = 'gif';
else die('resim_uzantisi_gecersiz');
header('Content-Type: image/'.$ext);
$ch = curl_init($resim);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7');
curl_setopt($ch, CURLOPT_REFERER, 'http://imageshack.us');
$resimcik = curl_exec($ch);
curl_close($ch);
echo $resimcik;
?>
Konu Oktigh tarafından (23-02-2011 Saat 13:14:41 ) değiştirilmiştir..
|