您的位置:首页 > 编程语言 > PHP开发

PHP中用header图片地址 简单隐藏图片源地址

2008-04-09 00:00 856 查看
<?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">
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: