First, with the HTTP header information
That is, using the header function of PHP. The function of the header function in PHP is to send the browser a control instruction that is supposed to pass through the Web server as specified by the HTTP protocol, such as declaring the type of return information ("Context-type:xxx/xxx"), the properties of the page ("No cache", " Expire ") and so on.
The following methods are used to redirect HTTP header information to another page:
Copy the Code code as follows:
$url = "Http://www.jb51.net";
if (Isset ($url))
{
Header ("Location: $url");
}
?>
Note: "Localtion:" There is a space behind, do not add sometimes can, but for correctness or added as well.
Second, with HTML tags
Use HTML markup, which is the refresh tag of meta, for example:
Copy the Code code as follows:
$url = "Http://www.jb51.net";
if (!isset ($url))
{
Exit (' No address to jump to Yo ');
}
?>
Copy the Code code as follows:
$url = "Http://www.jb51.net";
echo "";
?>
However, I personally prefer the header method, so that the page jumps faster, the user from the visual imperceptible to the whole page jump, but only local changes!
The above describes the Web redirect PHP redirect three ways to share, including the content of Web redirection, I hope to be interested in PHP tutorial friends helpful.