header函数(php中header()作用)

本文目录
php中header()作用
header的用法
标头 (header) 是服务器以 HTTP 协义传 HTML 资料到浏览器前所送出的字串,在标头
与 HTML 文件之间尚需空一行分隔。有关 HTTP 的详细说明,可以参 RFC 2068 官方文件
(
header(“Content-type: application/x-gzip“);
header(“Content-Disposition: attachment; filename=文件名\“);
header(“Content-Description: PHP3 Generated Data“);
?》
header重定向 就等价于替用户在地址栏输入url
---------------------------------
//刚好找到比较详细的资料!
header 函数如何实现当前窗口跳转
把searc()改成
function search(){
var sel = document.getElementsByName(“select“);//得到列表
var index = sel.options.selectedIndex;
var value = sel.options[index].value;//得到选择项的值
window.location.href=“b.asp“ + “?“ +“id=“ + value;
}
请参考
php header 函数不能正常跳转的几种解决办法
PHP页面跳转一、header()函数
header()函数是PHP中进行页面跳转的一种十分简单的方法。header()函数的主要功能是将HTTP协议标头(header)输出到浏览器。
header()函数的定义如下:
void header (string string [,bool replace [,int
《 ?php
$url = “http://www.guanwei.org“;
echo “《script language=’javascript’ type=’text/javascript’》“;
echo “window.location.href=’$url’“;
echo “《/script》“;
?》
PHP语言:header()函数
header(“Expires: Mon, 26 Jul 1997 05:00:00 GMT“);
header(“Last-Modified: “ . gmdate(“D, d M Y H:i:s“) . “GMT“);
header(“Cache-Control: no-cache, must-revalidate“);
header(“Pragma: no-cache“);
上面组合是禁用缓存
header(“Content-Language: charset=zh-cn“);
说明字符集是简体中文
header(“Content-type: text/html; charset=GB2312“);
说明本页面是HTML内容,字符集是简体中文

更多文章:
turtles歌曲(哪位大神有turtles(乌龟组合)的<谢谢>的歌词中文翻译 感激不尽)
2026年10月11日 10:00
金山铁路22号线(请问现在轨道交通22号线金山铁路是个什么情况据说9月28日就开通了啊~~~)
2026年10月11日 09:10
repercussions(都是余波,repercussions和aftermath有什么区别啊)
2026年10月11日 09:00
dropdownlist 绑定(DropDownList 绑定所有项 并 显示指定项)
2026年10月11日 08:50
易语言网页api接口怎么调用(易语言,怎么读取网页json的api)
2026年10月11日 08:00
majority of(the majority of 和 a majority of的区别以及用法例句)
2026年10月11日 07:40





