0
点赞
收藏
分享

微信扫一扫

php 隐藏图片地址

伊人幽梦 2023-03-29 阅读 109


代码:

 

test.php

 

<img src="test3.php?path=file/118812060.jpg"> 
<br>this is test!

 

test3.php

 

<?php
$path=$_GET["path"];
$cacheimgname=str_replace("/","_",$path);
$localimg="testimg/".$cacheimgname;

if ((file_exists($localimg)))
{
	$httpurl=$localimg;
}
else
{
	$httpurl="http://www.domain.com/".$path;
	@copy($httpurl,$localimg);//缓存图片!
}

header("Location:$httpurl");
exit;
?>

实际地址为:testimg/file_118812060.jpg

 

 

 

 

 

 

 

 

 

举报

相关推荐

0 条评论