远程调用163网易相册的代码PHP版本

收藏先,未经测试~
<?php
if(substr($_GET['url'], 0, 7)!="http://"){
exit;
}
readfile($_GET['url']);
?>
另外一种:
<?php 
/********************************************************************** 
突破防盗链的显示图片标签[simg],PHP程序部分 
*********************************************************************/ 
ob_start(); 
$img=$_GET[&#39;url&#39;]; 
$host=$path=str_replace(&#39;http://&#39;,&#39;&#39;,$img); 
$host=explode(&#39;/&#39;,$host); 
$host=$host[0]; 
$path=strstr($path,&#39;/&#39;); 
$fp = fsockopen($host, 80, $errno, $errstr, 30); 
if ($fp) 

@fputs($fp, \&#34;GET $path HTTP/1.1\\r\\n\&#34;); 
@fputs($fp, \&#34;Host: $host\\r\\n\&#34;); 
@fputs($fp, \&#34;Accept: */*\\r\\n\&#34;); 
@fputs($fp, \&#34;Referer: http://$host/\\r\\n\&#34;); 
@fputs($fp, \&#34;User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\\r\\n\&#34;); 
@fputs($fp, \&#34;Connection: Close\\r\\n\\r\\n\&#34;); 

$Content = &#39;&#39;; 
while ($str = fread($fp, 4096)) 
$Content .= $str; 
@fclose($fp); 
$pos=strpos($Content,\&#34;\\r\\n\\r\\n\&#34;); 
$head=substr($Content,0,$pos); 
$text=substr($Content,$pos+4); 
header($head); 
echo $text; 
?>
以后试试~
163相册速度可是很不错
调用方法:

http://yourweb/文件名.php?url=http://图片地址

1 条评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

返回主页看更多
狠狠的抽打博主 支付宝 扫一扫