HEADER functions
Header is a server that the server is transmitted by HTTP JDCI to HTML data to the browser. It is still empty between the header and the HTML file. For detailed description of HTTP, you can refer to RFC 2068 official document (http://www.w3.org/protocols/rfc2068/rfc2068). Before sending the HTML data in PHP, you need to pass all the headers first. Note: The traditional header must contain one of the three headers below and can only appear once. Content-Type: XXXX / YYYYLOCATION: XXXX: YYYY / ZZZZSTATUS: NNN XXXXXX can appear twice more in the new multi-headed MIME. Example example 1: This example resets the browser to the official website of PHP.
Header ("Location: http://www.php.net;>? Example 2: To get the latest information each time, instead of proxy or cache, you can use the following head
Header ("EXPIRES: MON, 26 JUL 1997 05:00:00 GMT"); Header ("Last-Modified:". Gmdate ("D, D MYH: I: S"). "GMT"); Header ("" Cache-control: no-cache, must-revALIDATE "); Header (" Pragma: no-cache ");>? Example 3: Let the user's browser can't find information about the file.
Header ("Status: 404 Not Found");>? Example 4: Let the user download the file.
Header ("Content-Type: Application / X-Gzip"); Header ("Content-Disposition: attachment; filename = file name"); Header ("Content-Description: PHP3 Generated Data);>?