Copy CodeThe code is as follows:
Fix 404 Pages:
Header (' http/1.1 OK ');
Set 404 Header:
Header (' http/1.1 404 Not Found ');
Set Moved permanently header (Good for redrictions)
Use with location header
Header (' http/1.1 301 Moved permanently ');
To implement redirection in ASP is to use the Response.Redirect function:
To use one example:
Response.Redirect ". /test.asp "
There are similar functions in PHP: Header
To use one example:
Header ("Location:.. /test.php ");
But there is a
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
The PHP header function describes how to set encoding, send HTTP status values, and redirect.
Php header utf8:
header(“Content-type: text/html; charset=utf-8″);
Php headers 404:
header(“HTTP/1.0 404 Not Found”);
The preceding two examples are
This article describes in detail the PHP header content-disposition usage in detail, there is a need to understand the use of the header of friends can refer to.
Content-disposition is an extension of the MIME protocol, and the MIME protocol
Use PHP header to implement file download, under IE6 always prompt cannot download, Google browser Normal, so should be IE problem, ie has a bug, Microsoft Official website has the description. Error message: "Internet Explorer cannot download a
PHP headers used in the HTTP protocol and common methods Summary, header summary
This paper summarizes the HTTP protocol used by headers in PHP and the common methods. Share to everyone for your reference. Here's how:
Copy CodeThe code is as
PHP header () output picture cache
In many developments, we tried to use the header ("Content-type:image/jpeg") to output images and try to use some PHP image processing techniques to make the output image more intelligent and dynamic. But we often
Copy CodeThe code is as follows:
Fix 404 Pages:
Header (' http/1.1 OK ');
Set 404 Header:
Header (' http/1.1 404 Not Found ');
Set Moved permanently header (Good for redrictions)
Use with location header
Header (' http/1.1 301 Moved permanently ');
1. There must be no space between location and:. Otherwise, an error will occur.
2. There cannot be any output before using the header.
3. php after Header
Code It will also be executed.
The following is a comparison with response. Redirect in ASP:
Used to demonstrate the PHP header () Function usage code, introduced the Refresh method, the foreigner wrote, of course, not too bad, the need for friends to refer to it.Example of header information for PHP header.
Override
Header (' content-type:application/pdf ');
Header (' content-disposition:attachment; filename= ' downloaded.pdf ');
ReadFile (' original.pdf ');
?>
Copy CodeDescription of the above code: the first sentence, just change the
A summary of common PHP header definitions and a summary of phpheader headers. The PHP header definition is summarized, and the phpheader header summary header () function sends the original HTTP header to the client. It is important to realize that
To implement redirection in ASP is to use the Response.Redirect function:
To use one example:
Response.Redirect ". /test.asp "
There are similar functions in PHP: Header
To use one example:
Header ("Location:.. /test.php ");
But there is a
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 ('
Common HTTP header settings for PHP header functions, Phpheader functions
Okheader (' http/1.1 OK ');//Set a 404 Header: Header (' http/1.1 404 Not Found ');//Set address is permanently redirected header (' http/1.1 301 Moved Permanently ');//Go to
PHP header sets the common file type of Content-type,
In PHP, you can send header information through the header function, you can also set the file Content-type, the following collation of some common file types for the Content-type value.
Date 201
Cause Analysis and Solution of PHP Header failure, header cause analysis
When using header ("location: test. PHP") in php to redirect, pay attention to the following points:
1. There must be no space between location and:. Otherwise, an error will
PHP header function usage and precautions, phpheader function details
void header ( string $string [, bool $replace = true [, int $http_response_code ]] ) : Send a raw HTTP header
Below are some usage of headers:
1. Use the header function to jump
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.