Header usage
The Header () function sends an original HTTP header [HTTP header] to the client.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.
The Header () function sends an original HTTP header [HTTP header] to the client.
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
Header ("location:http://bbs.it-home.org";);
exit;//add "Exit" after each redirect to avoid errors and continue execution.
?>
Copy Code2,
Header ("refresh:2;url=http://bbs.it-home.org");
Header ("location:http://bbs.it-home.org";);
Exit After each redirect, "Exit" must be added to avoid an error and continue execution.
?>
Header ("refresh:3;url=http://bbs.it-home.org");
Print (' Loading, please
header ()is used to send raw
HTTPHeaders. The http/1.1 specification for more information onHTTPHeaders.Example One:
Copy Code code as follows:
? Php
Header ("location:http://www.jb51.net";);
exit;//must add
The caching of the Web page is controlled by the "Cache-control" in the HTTP message header, the common value has private, No-cache, Max-age, must-revalidate, etc., the default is private. Its role is divided into the following situations according
The cache of the Web page is controlled by the "Cache-control" in the HTTP message header, and the common values are private, No-cache, Max-age, must-revalidate, etc., and the default is private. Its function is divided into the following situations
The PHP header function sets an example of an HTTP message header,
Define the encoding header (' Content-type:text/html;charset=utf-8 ');Atomheader (' Content-type:application/atom+xml ');Cssheader (' Content-type:text/css ');Javascriptheader ('
PHP uses the header function to set the HTTP header to parse the header. Copy the code as follows: define the encoding header (Content-Type: texthtml; charsetutf-8); Atomheader (Content-type: applicationatom + xml); CSSheader (Conten as follows:
/**
Desc:header functions to set various HTTP headers
link:bbs.it-home.org
Date:2013/2/24
*/
Defining the Encoding
Header (' Content-type:text/html;charset=utf-8 ');
Atom
Header ('
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.