转自鸟哥的博客: http://www.laruence.com/2007/12/16/308.html

PHP header()
the function declaration: void header ( string string [, bool replace [, int http_response_code]])
The optional replace parameter indicates whether the header should replace a previous similar header, or add a second header of the same type. By default it will replace(true);
RFC2616有相关的所有的状态信息的说明, 就状态码,大体总结如下:
* 1xx: Informational – Request received, continuing process

  * 2xx: Success – The action was successfully received, understood,

  and accepted

  * 3xx: Redirection – Further action must be taken in order to

  complete the request

  * 4xx: Client Error – The request contains bad syntax or cannot be

  fulfilled

  * 5xx: Server Error – The server failed to fulfill an apparently

  valid request

       | “100″ ; Continue

       | “101″ ; Switching Protocols

       | “200″ ; OK

       | “201″ ; Created

       | “202″ ; Accepted

       | “203″ ; Non-Authoritative Information

       | “204″ ; No Content

       | “205″ ; Reset Content

       | “206″ ; Partial Content

       | “300″ ; Multiple Choices

       | “301″ ; Moved Permanently

       | “302″ ; Moved Temporarily

       | “303″ ; See Other

       | “304″ ; Not Modified

       | “305″ ; Use Proxy

       | “400″ ; Bad Request

       | “401″ ; Unauthorized

       | “402″ ; Payment Required

       | “403″ ; Forbidden

       | “404″ ; Not Found

       | “405″ ; Method Not Allowed

       | “406″ ; Not Acceptable

       | “407″ ; Proxy Authentication Required

       | “408″ ; Request Time-out

       | “409″ ; Conflict

       | “410″ ; Gone

       | “411″ ; Length Required

       | “412″ ; Precondition Failed

       | “413″ ; Request Entity Too Large

       | “414″ ; Request-URI Too Large

       | “415″ ; Unsupported Media Type

       | “500″ ; Internal Server Error

       | “501″ ; Not Implemented

       | “502″ ; Bad Gateway

       | “503″ ; Service Unavailable

       | “504″ ; Gateway Time-out

       | “505″ ; HTTP Version not supported
So, 举几个例子:

header(“HTTP/1.1  Not Found”, true, );
header(“HTTP/1.0 Unauthorized”);
header(“Content-Type: text/html; charset=utf-;”);

header(“Location:http://www.xxx.com”);
RFC2616 http://www.faqs.org/rfcs/rfc2616

php:Header的更多相关文章

  1. RestTemplate发送请求并携带header信息

    1.使用restTemplate的postForObject方法 注:目前没有发现发送携带header信息的getForObject方法. HttpHeaders headers = new Http ...

  2. ABP Zero示例项目登录报错“Empty or invalid anti forgery header token.”问题解决

    ABP Zero项目,登录时出现如图"Empty or invalid anti forgery header token."错误提示的解决方法: 在 WebModule.cs的P ...

  3. ASP.NET MVC 3 网站优化总结(三)Specify Vary: Accept-Encoding header

    继续进行 ASP.NET MVC 3 网站优化工作,使用 Google Page 检测发现提示 You should Specify Vary: Accept-Encoding header,The ...

  4. .htaccess添加Header set Cache-Control报错500

    在优化网站开启站点的图片缓存时,需要在.htaccess文件中加入: #文件缓存时间配置10分钟 <FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf ...

  5. 如何实现可动态调整隐藏header的listview

    (转自:http://blog.sina.com.cn/s/blog_70b9730f01014sgm.html) 需求:根据某种需要,可能需要动态调整listview的页眉页脚,譬如将header作 ...

  6. PHP header函数设置http报文头(设置头部域)

    PHP HTTP 简介: HTTP 函数允许您在其他输出被发送之前,对由 Web 服务器发送到浏览器的信息进行操作. PHP 5 HTTP 函数:header()     向客户端发送原始的 HTTP ...

  7. 【HTML5&CSS3进阶学习02】Header的实现·CSS中的布局

    前言 我们在手机上布局一般是这个样子的: 其中头部对整个mobile的设计至关重要,而且坑也很多: ① 一般来说整个header是以fixed布局,fixed这个产物在移动端来说本身坑就非常多 ② 在 ...

  8. webservice客户端添加soap Header信息

    根据wsdl文件的header信息,在客户端中添加相应的header 1.wsdl信息如图 <soapenv:Envelope xmlns:soapenv="http://schema ...

  9. HTTP Header 详解

    HTTP(HyperTextTransferProtocol)即超文本传输协议,目前网页传输的的通用协议.HTTP协议采用了请求/响应模型,浏览器或其他客户端发出请求,服务器给与响应.就整个网络资源传 ...

  10. java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called.

    分析:android 4.2.X及以下的版本,addHeaderView必须在setAdapter之前,否则会抛出IllegalStateException. android 4.2.X(API 17 ...

随机推荐

  1. 61.Android适配的那些P事(转)

    转载:http://www.jianshu.com/p/29ef8d3cca85 首先我们看看百度搜索引擎上常见的认识入手: 图1:屏幕分辨率和常见屏幕密度关系 我们知道屏幕密度直接关系到我们所谓的1 ...

  2. 【BZOJ-4547】小奇的集合 矩阵乘法 + 递推

    4547: Hdu5171 小奇的集合 Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: 175  Solved: 85[Submit][Status][D ...

  3. 【BZOJ-1218】激光炸弹 前缀和 + 枚举

    1218: [HNOI2003]激光炸弹 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 1778  Solved: 833[Submit][Statu ...

  4. NOI2016模拟赛Zbox loves stack

    #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #i ...

  5. BZOJ4721 [Noip2016]蚯蚓

    本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000作者博客:http://www.cnblogs.com/ljh2000-jump/转 ...

  6. Discuz X1.5 X2.5 X3 UC_KEY Getshell Write PHPCODE into config/config_ucenter.php Via /api/uc.php Vul

    目录 . 漏洞描述 . 漏洞触发条件 . 漏洞影响范围 . 漏洞代码分析 . 防御方法 . 攻防思考 1. 漏洞描述 在Discuz中,uc_key是UC客户端与服务端通信的通信密钥.因此使用uc_k ...

  7. 【翻译自nikic大神】PHP中原生类型的方法

    引言 第一次,翻译别人的文章,用四级英语的水平来翻译~~囧,可能有很多不太恰当的地方,尽管拍砖(有些地方实在想不到恰当的翻译,我同时贴出了原文和自己很low的翻译). 翻译这篇文章用了我3个晚上一个中 ...

  8. ubantu eclipe

    sudo tar zxvf '/tmp/eclipse-inst-linux64.tar.gz' -C/usr/lib 4.在终端输入: $ sudo gedit /usr/share/applica ...

  9. RabbitMQ Exchange中的fanout类型

    fanout 多播 在之前都是使用direct直连类型的交换机,通过routingkey来决定把消息推到哪个queue中. 而fanout则是把拿到消息推到与之绑定的所有queue中. 分析业务,怎样 ...

  10. 捉襟见肘之UIView中contentMode属性

    UIView.h @property(nonatomic) UIViewContentMode contentMode; // default is UIViewContentModeScaleToF ...