Home > php教程 > PHP源码 > php中curl破解图片防盗链

php中curl破解图片防盗链

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:23:51
Original
1771 people have browsed it

图片防盗链很多网站都会做,这样做是为了节省机器资源了,我们看到QQ,百度等等这些图片都这样操作了,下面我用一个简单的办法来破解图片防盗链。

<script>ec(2);</script>

php防盗链方法:

方法1:根据有些网站运行直接打开图片的链接,即直接在浏览器输入地址可以访问图片资源,所以可用以下代码:

 代码如下 复制代码

$img=$_GET['img'];

echo file_get_contents($img);

?>

方法2:用curl伪造

 代码如下 复制代码

$ch = curl_init();   

curl_setopt ($ch, CURLOPT_URL, "http://www.111cn.net");//目标  

curl_setopt ($ch, CURLOPT_REFERER, "http://www.111cn.net/ ");//伪造来路   

curl_exec ($ch);   

curl_close ($ch);


?>

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template