How to hide pictures in php

藏色散人
Release: 2023-03-07 20:44:01
Original
1550 people have browsed it

How to hide pictures in php

Recommended: "PHP Video Tutorial"

The operating environment of this tutorial: Windows 7 system, PHP version 5.6, this method is suitable for all brands computer.

php Hide image address

Code:

test.php

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

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;
?>
Copy after login

The actual address is: testimg/file_118812060.jpg

For more programming-related knowledge, please visit: Programming Learning! !

The above is the detailed content of How to hide pictures in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template