Page jumps may be triggered by a user clicking on a link, a button, or a system that is automatically generated. Page automatic jump in the Web development is often used, and according to the requirements can be different jump mode, such as the prompt operation of information after the delay jump, this article summarizes the Web development of several common page jump methods.
PHP Header function Jump
PHP's header function is very powerful, which in the page URL jump is also called simple, use header to jump directly to the specified URL page, when the page jump is 302 redirect:
$url =;
Header (location: $url);
We may encounter a special jump, such as the site version of a page address to do 301 Redirect, of course, you can through the Web configuration rewrite to achieve, but now I want to tell you, you can use the header function PHP to do 301 jump, the code is as follows:
301 Jump
Header (http/1.1 moved Permanently);
Meta settings jump
Meta information in HTML can be set directly to jump, you can set the jump delay time and jump URL, often applied, such as paid to tell the user to pay success and jump to the order page, the code is very simple, add a sentence in:
</script>
Note that the above code directly after the jump, in the target page address is not access to the routing (Referer, also known as the source), in the actual project, encountered a customer requirements jump to bring the road (that is, the target page can get to the page from where the jump from), at this time, We can use JavaScript to simulate a click, and then jump to meet the needs of customers.
<script>
There are antecedents
var AA = document.createelement (a);
Aa.setattribute (href,);
var bodys=document.getelementsbytagname (body) [0];
Bodys.appendchild (AA);
Aa.click;
</script>
Of course, the actual development of the following two ways we can integrate into PHP, easy to apply a variety of jump needs.
The above mentioned is the entire content of this article, I hope you can enjoy.