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


<?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">

 

全文:http://www.jb51.net/article/14119.htm

 

posted @ 2015-05-19 12:56  stma  阅读(215)  评论(0)    收藏  举报