Header有没有办法向页面写入title标题

WBOY
Release: 2016-06-23 14:02:03
Original
2229 people have browsed it

以下是部分代码,现在打开页面时,页面中有内容,不过页面的title是网址,怎么写入这个标题。

Header("Content-type: application/octet-stream");
Header("Accept-Ranges: bytes");
Header("Accept-Length: ".filesize($pagename));
Header("Content-Disposition: attachment; filename=".iconv("utf-8", "gb2312", $r[title]).".txt");


回复讨论(解决方案)

你这不是文件下载吗?

是文件下载,我看到百度收录的页面中全是网址,没有标题, 所以工想加标题。

加不了标题的 因为title是文件内容

打开一个新的页面下载 把title传到

$title即可

打开一个新的页面下载 把title传到

$title即可

header所做的工作一般是指http协议的header,而不是html文档的header,厘清这个概念吧

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