一般一些大站和博客都有设置图片防盗链,比如百度贴吧
下面来放出破解防盗链的代码:
<?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 ); ?>
把代码保存为tu.php 名称可以自己随便写
调用方式:
https://www.isays.cn/itu.php?url=http://e.hiphotos.bdimg.com/album/s%3D740%3Bq%3D90/sign=eeeaa514a60f4bfb88d09c50337409cd/902397dda144ad34356a4d0cd2a20cf430ad8560.jpg
演示地址:https://www.isays.cn/5723.html
源码来自:AIR大神 i科技
谢谢分享:)
不知可否友情链接fangker