The happy life of an otaku in the ancient harem txt. The hyperlink connected to the txt text is not opened directly but downloaded after clicking.

WBOY
Release: 2016-07-29 08:40:17
Original
2028 people have browsed it

There are two processing methods on the server side. One is to set it in a server such as apache or iis or tomcat, or to specify the sending type in the program.
This information belongs to http header information, and PHP has functions to directly operate on header information.
How to implement php:

Copy the codeThe code is as follows:


header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".basename($_GET['url']));
readfile($filename);
?>


The above introduces the method of processing the hyperlink to the txt text, which is not opened directly but downloaded after clicking. It includes the content of the happy life of otaku in the ancient harem txt. I hope it will be helpful to PHP tutorial is helpful for those who are interested.

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
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!