Php url redirection methods)

Source: Internet
Author: User
[Using the header () function] PHP's HTTP-related function provides a header () function. First, you must be clear that the header () function must be placed at the beginning of the php program, in addition, no other header () function or setcookie () function can be called before... syntaxHighli

[Use the header () function]
The HTTP-related function type of PHP provides a header () function. First, it must be clear that the header () function must be placed at the beginning of the php program, and there cannot be another header () the function or setcookie () is called. if it contains webpage output, this statement must be placed before the mark.

Use the following statement:

Header ("location: http://www.bibias.com ");
Exit;
?>

As long as this statement is executed, the web page will be automatically redirected to the http://www.bibias.com


[Use HTML to Mark redirection]




If (isset ($ url ))
{
Echo" ";
}
?>




CONTENT = "5; url = $ url" indicates that after 5 seconds, the webpage will automatically turn to the address $ url.


[Implement redirection using js scripts]



$ Url = "http://www.bibias.com ";
Echo"

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.