复制代码 代码如下:

<?php       
$path=$_GET["path"];       
$cacheimgname=str_replace("/","_",$path);       
$localimg="upimg/".$cacheimgname;       
if ((file_exists($localimg)))       
{       
$httpurl=$localimg;       
}       
else      
{       
$httpurl="http://www.imageserver.com/".$path;       
@copy($httpurl,$localimg);//缓存图片!       
}       
header("Locationhttpurl");       
exit;       
?>   

调用它类似这样:
复制代码 代码如下:

<img src="img.php?path=x/x/xtest.gif">  

点赞(98)

评论列表共有 0 条评论

立即
投稿
返回
顶部