Headers (header) is a string sent by the server before the HTTP coprocessor to the browser, in the header
There is still an empty line separating from the HTML file. For more information about HTTP, you can participate in RFC 2068 official documents
(http://www.w3.org/Protocols/rfc2068/rfc2068). Before sending back HTML data in PHP, you need to first
All headers are passed through.
Note: The traditional header must contain one of the following three kinds of headers and can only appear once.
The new multi-header specification (Multipart MIME) can appear more than two times.
Usage examples
Example one: This example redirects the browser to the official website of PHP.
Header ("Location:http://www.php.net");
Exit
"?"
Example two: You can use the following headers when you want the user to get the latest information, not the Proxy or cache data.
Header ("Expires:mon, June June 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 three: Let the user's browser appear to be unable to find the file information.
Header ("status:404 not Found");
"?"
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.