php中curl破解图片防盗链
php防盗链方法:
方法1:根据有些网站运行直接打开图片的链接,即直接在浏览器输入地址可以访问图片资源,所以可用以下代码:
<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy2493')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy2493><?php
$img=$_GET['img'];
echo file_get_contents($img);
?>
方法2:用curl伪造
<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy1966')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy1966><?php
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, "http://www.jiaochengji.com");//目标
curl_setopt ($ch, CURLOPT_REFERER, "http://www.jiaochengji.com/ ");//伪造来路
curl_exec ($ch);
curl_close ($ch);
?>
您可能感兴趣的文章:
PHP防盗链图片怎么破解?实例代码
php中curl破解图片防盗链
php破解apache,nginx,iis防盗链图片
PHP禁止图片盗链
php实现图片批量下载到本地实例(可采防盗链)
php采集防图片盗链方法
PHP禁止图片文件的被盗链函数
php中图片防盗链如何绕过的方法
php下载网络图片常用的三个方法总结
asp.net使用ashx实现图片防盗链的方法