Discover document header examples, include the articles, news, trends, analysis and practical advice about document header examples on alibabacloud.com
If you are just beginning to learn PHP, there may be many functions to study, today we will learn how to use the PHP Header (), more instructions, please refer to the PHP Chinese manual, the following is about the Header function detailed use
To obtain the best results, first determine whether you only need to display the page number, or whether you want to display the information and page number in the header or footer. If you need a page number without any additional information, add
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
/**
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 ('
If you have just started to learn PHP, there may be many functions need to study, today we will learn how to use the PHP Header (), more instructions, please refer to the PHP Chinese manual, the following is a detailed use of the header function
If you have just started to learn PHP, there may be many functions need to study, today we will learn how to use the PHP Header (), more instructions, please refer to the PHP Chinese manual, the following is a detailed use of the header function
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
Regardless of how many headers the page has, it executes the last one, but conditionally, for example:
Header (' location:http://www.jb51.net ');
Header (' location:http://www.g.cn ');
Header (' location:http://www.baidu.com ');
This will jump to
Common http header settings for php header Functions
This article mainly introduces the common http header settings of php header functions. This article provides code examples. The Code contains detailed comments. For more information, see
?
First look at the definition of official documents(PHP 4, PHP 5, PHP 7)header- Sending native HTTP headers1 Header string $string $replace true $http _response_code ]] )Parameters: StringThere are two kinds of special heads. The first type of "http/
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.