您好,欢迎访问一九零五行业门户网

PHP函数header发放HTTP头信息_PHP教程

// 向浏览器发送404 状态码
header(“http/1.1 404 not found”);
或者
header(“http/1.1 404″);
// 永久重定向
header(“location: http://weizhifeng.net/”);//默认是301 跳转
// 临时重定向
header(“http/1.1 302 found”);
header(“location: http://weizhifeng.net/”);
// 下载文件
header(“content-type: text/plain’); // 可以替换成你需要的mime类型
header(‘content-disposition: attachment; filename=”weizhifeng.txt”‘);
readfile(‘weizhifeng.txt’);
其他的头信息可以参考http/1.1 specification
如果在header之前已经有了输出,那么请使用ob_start()函数。
http://www.bkjia.com/phpjc/445995.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/445995.htmltecharticle// 向浏览器发送404 状态码 header(http/1.1 404 not found); 或者 header(http/1.1 404); // 永久重定向 header(location: http://weizhifeng.net/);//默认是301 跳转 //...
其它类似信息

推荐信息