楼主不是要显示BAIDU禁止外链的图片
而是想在空间的控制面板里设置下,使得网站可以访问:( 证明了 原帖由 飞狼 于 2008-4-28 14:27 发表 http://jgwy.net/images/common/back.gif
百度在服务器上启用了“防盗链”功能,用这个网站可以破解!
在你对外引用的图片前加上http://www.thelionking.org.cn/kill-pic.asp?就可以了!
比如:http://www.thelionking.org.cn/kill-pic.asp?http://hip ...
有这个代码不 ? 我网上找了下 没找到可用的
最好PHP 的 <?php
ob_start();
$img=$_GET['url'];
$host=$path=str_replace('http://','',$img);
$host=explode('/',$host);
$host=$host;
$path=strstr($path,'/');
$fp = fsockopen($host, 80, $errno, $errstr, 30);
if ($fp)
{
@fputs($fp, \"GET $path HTTP/1.1\\r\\n\");
@fputs($fp, \"Host: $host\\r\\n\");
@fputs($fp, \"Accept: */*\\r\\n\");
@fputs($fp, \"Referer: http://$host/\\r\\n\");
@fputs($fp, \"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\\r\\n\");
@fputs($fp, \"Connection: Close\\r\\n\\r\\n\");
}
$Content = '';
while ($str = fread($fp, 4096))
$Content .= $str;
@fclose($fp);
$pos=strpos($Content,\"\\r\\n\\r\\n\");
$head=substr($Content,0,$pos);
$text=substr($Content,$pos+4);
header($head);
echo $text;
?>是这个么?
页:
1
[2]