当前位置: 首页 > 键盘游走者发布的所有文章
  • PHP中用header:图片地址 简单隐藏图片源地址

    PHP代码
    1. $path=$_GET[“path”];      
    2. $cacheimgname=str_replace(“/”,“_”,$path);      
    3. $localimg=“upimg/”.$cacheimgname;      
    4. if ((file_exists($localimg)))      
    5. {      
    6. $httpurl=$localimg;      
    7. }      
    8. else     
    9. {      
    10. $httpurl=“http://www.imageserver.com/”.$path;      
    11. @copy($httpurl,$localimg);//缓存图片!      
    12. }      
    13. header(“Locationhttpurl”);      
    14. exit;      
    15. ?>    

    调用它类似这样:

     

     

    PHP代码
    1. “img.php?path=x/x/xtest.gif”>    
    ]]>

    键盘游走者 发布于 2007-12-03 18:08php抢沙发