Introduction: This is a detailed page for using the header function. It introduces PHP, related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 326967 'rolling = 'no'>
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 ");
>?
More articles on "header function usage"
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/326967.html pageno: 13.