How to hide the real download path in php

藏色散人
Release: 2023-03-04 07:08:01
Original
2592 people have browsed it

php method to hide the real path: first create a "test.html" file; then create a "dow.php" file; finally pass "if($_REQUEST["id"]==1){ ...}" method to hide the real file path.

How to hide the real download path in php

Recommended: "PHP Video Tutorial"

php hidden download real path example code

Sometimes when we use PHP to download, we don’t want others to see the real path of the file. What should we do? Let me use an example to show you how to hide the real file path.

test.html file

<a href="dow.php?id=1">100素材网</a>
Copy after login

dow.php file

<?php
header("Content-type:application");
if($_REQUEST["id"]==1){
$fileurl="a/Discuz_X3.1_SC_GBK.zip";
header("Content-Disposition: attachment; filename=$fileurl");
readfile($fileurl);
exit(0);
}
?>
Copy after login

The above is the detailed content of How to hide the real download path 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!