您现在的位置:
  1. 首页
  2. 建站
  3. php破解图片防盗链

php破解图片防盗链

php代码如下:

<?php
$url = $_GET[“url”];
//$url = str_replace(“http:/”,”http://”,$url);
$dir = pathinfo($url);
$host = $dir[‘dirname’];
$refer = $host.’/’;
$ch = curl_init($url);
curl_setopt ($ch, CURLOPT_REFERER, $refer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);//Activation can modify the page
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
header(“Content-type: image/jpeg”);//Code to support jpeg, need to modify to support other image formats
print( $data );
?>

要用的话可以使用http://www.upinba.com/image.php?url=图片地址
其中image.php为自己给php文件命的文件名。

发表评论

必填

必填