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
PHP header function usage example summary: hope to help you!1. Not found on the pageHeader ('HTTP/1.1 404 Not found ');2. Use this header command to solve the 404 header generated by URL rewriting.Header ('HTTP/1.1 200 OK ');3. Restricted
In php, header redirection uses include to solve the problem of parameter loss.
If you encounter problems in a project, when a user successfully logs on to the homepage with the header, it is always wrong and cannot jump to the page you want. It
PHP header functions can be fewCodeYou can implement meta tags in HTML code.Here we only use the header function for page Jump.
1. page Jump code in HTML codeHTML Meta Refresh refresh and redirect pageRefresh property value-refresh and redirect
PHP header function tutorialDefinition and usageThe header () function sends an original HTTP header to the client.It is important to see that the title () must be sent in any so-called actual output (after PHP 4 and later, you can use the output
PHP header () Usage tips
The following is a detailed description of the use of the header function:
Regardless of how many headers the page has, it executes the last one, but conditionally, for example:
This will jump to Baidu
The role of the
Sublime Editor How to quickly enter PHP header version declaration
Sublime menu bar->tools→new snippet→ get as content:
Enter the following:
<>> > <>
<>/** * @version 1.0 * @author xinhua3 * @date */ ]]>>
<>> Phpheader> > <>
PHP Header Cache---header parameter description
1. Accept: Tell the Web server what type of media you accept, */* represents any type, type/* represents all subtypes under that type, Type/sub-type.
2. Accept-charset:?? The browser affirms the
PHP header Problem
The code appears as follows Warning:cannot Modify header Information-headers already sent by (output started at D:\APPSERV\WWW\ADMIN_CHEC k.php:1) in D:\AppServ\www\admin_check.php on line 10
Require_once '
1. Compile PHP header and bottom reference
[9:48:00 |:Tong]
Each page has the same header and bottom. As shown in the preceding figure, the same information can be written to each page when the workload is
PHP header () functionPHP HTTP functionsDefinition and usageThe header () function sends the original HTTP header to the client.It is important to recognize that the header () function must be called before any actual output is sent (in PHP 4 and
The cache in the PHP header () has four types of identity headers: Last-modified,expires,pragma:no-cache,cache-control.The following test environment is Google Chrome, the rest of the tests are not tested
Last-modified: When judging the
The header is divided into three parts:
The first part is the HTTP protocol version (http-version);The second part is state code (status);The third part is the causal phrase (reason-phrase).
Header () Function usage Description:
First, the role:~~
In general, our management background is the use of frameset to layout, so if we set the login session time in the background, then after the expiration of the session, then we must be in the PHP file to determine processing.After you have
This article mainly introduced PHP header set common file types of Content-type related information, need friends can refer to the following
In PHP, you can send header information through the header function, and you can set the Content-type of
In PHP, use header ("location:test.php") to jump to note the following points:
1, location and ":" No space between the number, or there will be errors.
2, in the use of header can not have any output, including the page included in the label "?>"
The header in PHP is divided into three parts:The first part: The version of the HTTP Protocol (http-version);The second part: status code;The third part: The reason phrase (reason-phrase).Example code:Return page HTTP information with the header
Copy codeThe Code is as follows:/*** Function: PHP header () examples (PHP)** Desc: Some examples on how to use the header () function of PHPYou find a detailed tutorial at expertsrt.com (English) or at ffm.junetz.de (German ). these is also a good
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.