Home  >  Article  >  Backend Development  >  Another Brilliant Life PHP page jumps to another page summary of various methods

Another Brilliant Life PHP page jumps to another page summary of various methods

WBOY
WBOYOriginal
2016-07-29 08:40:19777browse

1. Use HTTP header information
That is, use PHP’s HEADER function. The function of the HEADER function in PHP is to issue control instructions to the browser that should be passed through the WEB server specified by the HTTP protocol, such as declaring the type of return information ("Context-type: xxx/xxx"), the attributes of the page ("No cache", "Expire"), etc.
The method of redirecting to another page using HTTP header information is as follows:

Copy the code The code is as follows:


if (isset($url))
{
Header("HTTP/1.1 303 See Other");
Header("Location: $url");
exit; //from www.w3sky.com
}
?>


Note that there is a space after "Localtion:".
2. Mark with HTML
Mark with HTML, that is, use the REFRESH mark of META, for example:

Copy the code The code is as follows:





Copy code The code is as follows:


$url="http://www .jb51.net";
echo "