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 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['PATH_INFO'])))); if(file_exists("upload/".$_SERVER['PATH_INFO'])) echo file_get_contents("upload/".$_SERVER['PATH_INFO']); else echo file_get_contents("static/404.png"); ?>
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!