Php page jump implementation program code. Below we have summarized several methods of page jump in php. to achieve page jump in php, we need to use the header function. below I will introduce all of my friends who need it for reference. Below is a summary of several page jump methods in php. to achieve page jump in php, you need to use the header function. below I will introduce all the users who need it for reference.
The simplest is to use php header to implement
The code is:
| The code is as follows: |
|
|
Header ("Location: http://www.bKjia. c0m /");
?>
Or:
|
Get the value through get or post before redirecting
Sometimes you can see http://www.xxx.com/url.php? Url = http://www.baidu.com, then jump to Baidu.
How can I use php to redirect this url?
Only a few simple lines of code can be implemented.
| The code is as follows: |
|
|
$ Url = $ _ GET ["url"];
Header ("Location:". $ url );
?> |
PHP 301 redirection implementation code
| The code is as follows: |
|
|
$ Url = ""];
Header ("HTTP/1.1 301 Moved Permanently ");
Header ("Location: $ url ");
?> |
View status code in ff
It's easy. use the small software curl for testing.
# Curl-I
HTTP/1.0 301 Moved Permanently
Date: Tue, 06 May 2008 06:27:39 GMT
Server: apache
Location:
See the above HTTP/1.0 301 Moved Permanently
Bytes. The simplest...