欢迎访问YiiCms企业站系统 English/中文
联系电话:13240702278
<ul style="margin-right: 1.5em; margin-bottom: 1.5em; margin-left: 1.5em; padding: 0px 0px 0px 1em; border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;" class=" list-paddingleft-2"><li><p>作者: <a href="http://www.laruence.com/" style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; color: rgb(0, 0, 204);">Laruence</a>(<a href="http://www.twitter.com/laruence" target="meme" title="Twitter" style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; color: rgb(0, 0, 204);"><img src="http://www.laruence.com/images/ico-twitter.png"/></a> <a href="http://t.sina.com/laruence" target="meme" title="新浪微博" style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; color: rgb(0, 0, 204);"><img src="http://www.laruence.com/images/ico-sina.png"/></a> <a href="http://fusion.google.com/add?feedurl=http://www.laruence.com/feed" target="meme" title="Google阅读器" style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; color: rgb(0, 0, 204);"><img src="http://www.laruence.com/images/ico-google.png"/></a> <a href="mailto:laruence@yahoo.com.cn" target="meme" title="邮件" style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; color: rgb(0, 0, 204);"><img src="http://www.laruence.com/images/ico-mail.png"/></a>)</p></li><li><p>本文地址: <a href="http://www.laruence.com/2007/12/16/308.html" title="Permanet Link to PHP:Header" style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; color: rgb(0, 0, 204);">http://www.laruence.com/2007/12/16/308.html</a></p></li><li><p>转载请注明出处</p></li></ul><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">刚在网上看到一个家伙抨击了半天Smarty,ajax,并叫嚣着,凡是写blog的都是菜鸟,高手都是隐隐的,唉,那我这只菜鸟就继续再写点今天整理的一些个东西喽:<br/>PHP header()<br/>the function declaration: void header ( string string [, bool replace [, int http_response_code]])<br/>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);<br/>RFC2616有相关的所有的状态信息的说明, 就状态码,大体总结如下:<br/>* 1xx: Informational – Request received, continuing process</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">  * 2xx: Success – The action was successfully received, understood,</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">  and accepted</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">  * 3xx: Redirection – Further action must be taken in order to</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">  complete the request</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">  * 4xx: Client Error – The request contains bad syntax or cannot be</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">  fulfilled</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">  * 5xx: Server Error – The server failed to fulfill an apparently</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">  valid request</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “100″ ; Continue</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “101″ ; Switching Protocols</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “200″ ; OK</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “201″ ; Created</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “202″ ; Accepted</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “203″ ; Non-Authoritative Information</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “204″ ; No Content</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “205″ ; Reset Content</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “206″ ; Partial Content</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “300″ ; Multiple Choices</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “301″ ; Moved Permanently</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “302″ ; Moved Temporarily</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “303″ ; See Other</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “304″ ; Not Modified</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “305″ ; Use Proxy</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “400″ ; Bad Request</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “401″ ; Unauthorized</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “402″ ; Payment Required</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “403″ ; Forbidden</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “404″ ; Not Found</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “405″ ; Method Not Allowed</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “406″ ; Not Acceptable</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “407″ ; Proxy Authentication Required</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “408″ ; Request Time-out</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “409″ ; Conflict</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “410″ ; Gone</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “411″ ; Length Required</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “412″ ; Precondition Failed</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “413″ ; Request Entity Too Large</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “414″ ; Request-URI Too Large</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “415″ ; Unsupported Media Type</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “500″ ; Internal Server Error</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “501″ ; Not Implemented</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “502″ ; Bad Gateway</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “503″ ; Service Unavailable</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “504″ ; Gateway Time-out</p><p style="margin-top: 0px; margin-bottom: 1.5em; padding: 0px; border: 0px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; vertical-align: baseline; text-indent: 1em; color: rgb(34, 34, 34); white-space: normal; background-color: rgb(255, 255, 255);">       | “505″ ; HTTP Version not supported<br/>So, 举几个例子:<br/>header(“HTTP/1.1 404 Not Found”, true, 404);<br/>header(“HTTP/1.0 401 Unauthorized”);<br/>header(“Content-Type: text/html; charset=utf-8;”);<br/>header(“Location:http://www.xxx.com”);<br/>RFC2616 http://www.faqs.org/rfcs/rfc2616</p><p><br/></p>

联系我们

公司: 在北京网络科技有限公司

联系人: 李先生

QQ: 739800600 点击这里给我发消息

E-mail: 739800600@qq.com

地址: 北京市丰台区大红门

QQ群:248898849

超值活动: 香港空间+域名+程序(YiiCms)+维护=1000元/年

捐赠我们

支付宝扫码捐赠我们

小电影