How to send head information in PHP
As described in Mr. Peng Wuxing, Header can send a Status header, such as Phpheader ("status: 404 not found");> You can let the user browser appears 404 errors But I tried it. Later I went to W3.org to check the relevant information about HTTP, I finally tried out how the Header's state code (STATUS) is shared with you. It should actually be like this: Header ("http / 1.1 403 forbidden");?> The first part is the second part of the HTTP protocol (http-version) Part III for the Status Code (Reason-Phrase) The three parts are separated by a space, and the middle cannot have a carriage return, the first part and the second part are required, and the third part is to people, it can be written without writing. Also, the output of this sentence must be in the first line of the HTML file.
Below I gave the meaning represented by each code (is from W3.org, enough authority): * 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 can not be fulfilled * 5xx: Server Error - The server failed to fulfill an apparently valid request | "100 "; Continue |" 101 "; Switch Protocols |" 200 "; OK |" 201 "; create |" 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 request | "403" Forbidden | "404"; NOT FOUND | "405"; Method Not Allowed | "406"; NOT ACCEPTABLE | "407"; Proxy Authentication Required | "408"; Request Time-Out | "409"; Conflict | 410 ";" 412 "; precondition failed |" 413 "; Request Entity TOO LARGE |" 414 "; Request-Uri Too Large |" 415 "; unsupported Media Type |" 500 "; Internal Server Error | "501";