How does a page redirect from one page to another in PHP? Here are a list of three options for your reference.
First, with HTTP header information
That is, using the header function of PHP. The function of the header function in PHP is to issue to the browser the control instructions that should have been passed through the Web server, such as declaring the type of return information ("Context-type:xxx/xxx"), the properties of the page ("No cache", " Expire ") and so on.
The way to redirect to another page with HTTP header information is as follows:
?
if (Isset ($url))
{
Header ("http/1.1 303 and Other"); [Thank you, Mr. Li]
Header ("Location: $url");
Exit
}
?>
Notice that "localtion:" There is a space behind it.
Second, with HTML tags
With HTML tags, you use the Meta refresh tag, for example:
? if (!isset ($url)) exit;? >
<HTML>
<HEAD>
<meta http-equiv= "REFRESH" content= "5; url=<? echo $url;? >>
</HEAD>
<BODY>
</BODY>
</HTML>
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.