How to hide image address in php

coldplay.xixi
Release: 2023-03-06 12:10:01
Original
2253 people have browsed it

How to hide the image address in php: modify upload to the directory of the image to be hidden, the code is [if(file_exists("upload/".$_SERVER['PATH_INFO']))].

How to hide image address in php

How to hide the image address in php:

is simpler than those on the Internet (the ones on the Internet basically cannot be used) ) Modify upload as the directory of the pictures you want to hide, static/404.png as your 404 picture directory

The effect is xxx.php/xx.xx (as long as it is the picture type! The type can be automatically determined !)

 <?php
 header("Content-type: image/".(@end(explode(".","upload/".$_SERVER[&#39;PATH_INFO&#39;]))));
 if(file_exists("upload/".$_SERVER[&#39;PATH_INFO&#39;]))
   echo file_get_contents("upload/".$_SERVER[&#39;PATH_INFO&#39;]);
    else
    echo file_get_contents("static/404.png");
 ?>
Copy after login

If you want to learn more about programming, please pay attention to the php training column!

The above is the detailed content of How to hide image address 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