Header function usage. The header is the string sent by the server before the server passes HTML data to the browser using HTTP co-definition. a blank line is required between the header and the HTML file. For more information about HTTP, the header is the string sent by the server before the server passes HTML data to the browser with HTTP co-meaning.
Separate HTML files with a blank line. For more information about HTTP, see the RFC 2068 official file.
Http://www.w3.org/Protocols/rfc2068/rfc2068 ). Before Sending HTML data back to PHP, you must first
All the headers are uploaded.
Note: The traditional header must contain one of the following three headers and can only appear once.
Content-Type: xxxx/yyyy
Location: xxxx: yyyy/zzzz
Status: nnn xxxxxx
The new Multipart MIME type can appear more than twice.
Example
Example 1: In this example, the browser is redirected to the official PHP website.
Header ("Location: http://www.php.net ");
Exit;
>?
Example 2: to obtain the latest data every time, instead of the data in the Proxy or cache, you can use the following header
Header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT ");
Header ("Last-Modified:". gmdate ("D, d m y h: I: s"). "GMT ");
Header ("Cache-Control: no-cache, must-revalidate ");
Header ("Pragma: no-cache ");
>?
Example 3: make the user's browser unable to find the file information.
Header ("Status: 404 Not Found ");
>?
Example 4: allow users to download files.
Header ("Content-type: application/x-gzip ");
Header ("Content-Disposition: attachment; filename = file name ");
Header ("Content-Description: PHP3 Generated Data ");
>?
The forward (header) is a string sent by the server before the server passes HTML data to the browser using HTTP co-definition. a blank line is required between the header and the HTML file. For more information about HTTP, see...