How to convert the code of Header output status in PHP

Source: Internet
Author: User
As described in PHPBIBLE by Mr. Peng Wuxing, the header can send the Status header. for example, a 404 error cannot be found in the user's browser, but I tried it. Later, I checked the relevant http information on w3.org and finally found out how to output the Status code (Status) SyntaxHighlig.

According to Mr. Peng Wuxing's PHP Le, the header can send the Status header, as shown in In this way, the user's browser can see the 404 error that the file cannot be found, but I tried this. Later, I checked the relevant http information on w3.org and finally found out how to output the Status code (Status) in the Header to share with you. It should be like this: Header ("http/1.1 403 Forbidden");?> The first part is the HTTP Version. The second part is the Status code. The third part is the Reason-Phrase, there cannot be carriage return in the middle. The first part and the second part are required. The third part is for people to see. it can be written, not written, or even written in disorder. Also, the output of this sentence must be in the first line of the Html file. Below I will show the meaning of each code (it is found on w3.org and authoritative): * 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.