OK header (' http/1.1 ok ');
Set a 404 Header: Header (' http/1.1 404 Not Found ');
Set address to be permanently redirected header (' http/1.1 moved Permanently ');
Go to a new address header (' location:http://www.example.org/');
File Delay
Grammar:
Copy Code code as follows:
Void Header (String $string [, bool $replace =true [, int $http _response_code)
Send the original HTTP header to the client
Need to note:
The header function must be invoked before any actual
Copy Code code 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 moved Permanently ');
In the PHP language, the header () function is useful, especially when using Ajax, he will help you solve some unexpected problems. Here is some detailed explanation of header. I hope it's helpful to phper.
Copy Code code as follows:
Here are a few ways to jump:
One of the most common methods on the Web:
The code is as follows
Copy Code
$url = $_get[' url '];Header ("Location: $url");?>
Put this code in a folder, named for example go.php
The code is as follows
Copy Code
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 headerHeader (' http/1.1 moved
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
Use PHPheader to troubleshoot page jumps. We usually use header (location: test. php) for jump, pay attention to the following points, which helps solve some problems that beginners often encounter. 1. l we usually use
When using header ("location:
The following small series for you to share a PHP header of the different usage summary (example), I believe many students at the beginning to know
PHPThe header is the declaration of the font encoding, then today is to break your previous
PHPIn the
Link to the original article: PHPHeader has found this article by summarizing several issues that should be paid attention to during page Jump with php skills. At the beginning, I mentioned three precautions for PHPheader (), location and ":. There
Whether exit exists after phpheader. After phpheader, do you need to write exit to terminate the program? I didn't care too much about it before. today I encountered a bug and found this problem. I wrote a code segment to test it, code such as php
The ThinkPHPredirect method can be used to redirect pages. The redirect Method syntax is as follows: ThinkPHP redirect Method
The ThinkPHP redirect method enables page redirection (redirection. Redirect
The method syntax is as follows:
PHP setcookie () or PHP header (' location: ') not working–with solutionthe Setcookie () or header () Functions of PHP does no T work at all!
The PHP Setcookie () and header () should is called before any browser output. If there is any echo or
How to change a common form login to a phpcurl simulated form login
2. php
header('Content-Type:text/html;Charset=utf-8');if ($_POST['loginname'] == 'lee' && $_POST['loginpass'] == '123456') { header('location:http://bbs.csdn.net');} else
This article introduces the commonly used page jump implementation methods, including the JS php asp.net these three kinds of implementation code, there is a need to understand friends can refer to.
First to introduce the practice of JS
When creating an image download site, users often need to download images, but the image browser can open them directly. what should I do? Is there any way to download an image file in the pop-up download box? phperz.com certainly does, the php
In php writing, user page jumps are sometimes made. Several good jump methods are collected here, which can be used. None, that is, use the php header function. The HEADER function in PHP is used to send control commands that should have been
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.