PHP redirection solution

Source: Internet
Author: User
PHP redirection Method 1: header (& quot; Location: index. php & quot;); & nbsp; Method 2: echo & quot; & lt; script & gt; window. location =\& quot; about PHP redirection
Method 1: header ("Location: index. php ");



Method 2: echo "script window. location = \" $ PHP_SELF \ "; script";



Method 3: echo" ";



Method 4:
Ob_start ();

?>

Html code


Ob_clean ();

Include ("next. php ");

Ob_end_flush ();

?>

What else is not added ..

------ Solution --------------------
It should be the wood .. However, both 1, 2, and 3 are Redirection. This means that the browser receives the first http response and then sends an http get request to the second page.
4. it is a file introduction, not a jump.
------ Solution --------------------


This avatar is cute...
------ Solution --------------------
Are the four types not enough?
This cute: http://my.csdn.net/my/album/detail/1074601
------ Solution --------------------
I think redirection should be the first one that is used much more: header ("Location: index. php ");

For example, 301,404 redirection. Header ("HTTP/1.0 404 Not Found"); these are common in open-source systems.

------ Solution --------------------
No

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.