[Reprint] three steps to learn PHP redirection

Source: Internet
Author: User
[Reprint] how can I learn PHP redirection in three ways ??? How to learn three methods of PHP redirection: wenku.baidu.comview794fec76a415866fb84a8e63.html ??? 1. use HTTP header information ??? That is, use the php header function. The HEADER function in PHP is used to send a [reprint] to the browser to learn the three methods of PHP redirection stipulated by the HTTP protocol.

?

?

?

Three methods for learning PHP redirection

Http://wenku.baidu.com/view/794fec76a417866fb84a8e63.html

??? I,HTTP header information

??? That is, use the php header function. The HEADER function in PHP is used to send control commands that should have been specified by the HTTP protocol to the browser through the WEB server. for example, to declare the type of the returned information ("Context-type: xxx/xxx "), page attributes (" No cache "," Expire "), and so on.

??? To redirect an HTTP header to another page, follow these steps:

$ Url = http://www.mycodes.net;
If (isset ($ url ))
{
Header ("Location: $ url ");
}
?>


??? Note: "Localtion:" There is a space behind it. if it is not added, it can also be used, but it is better to add it for correctness.

??? II,Mark with HTML

??? The HTML tag is the REFRESH tag of META, for example:

$ Url = http://www.mycodes.net;
If (! Isset ($ url ))??? ?
{
Exit ('No jump address you ');
}
?>







??? Note: content = "5; url = 'http: // www.mycodes.net '" indicates the jump address and will be executed in 5 seconds.

??? III,Implement with scripts

$ Url = http://www.mycodes.net;
Echo"

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.