PHP header function output-php Tutorial

Source: Internet
Author: User
Analysis of PHP header output
 "; Header ('Location: http://www.baidu.com ');/* but run the above found successful jump name, because this does not conform to the HTTP specification of the HTTP header, it is likely that the entire HTTP Response cannot be parsed. Fortunately, PHP seems to have fixed the problem of the HTTP header format for you. The problem of starting an HTTP header does not need to be output after the HTTP content is output. However, the server will cache the output. although you have used echo or print, the server did not output the content as an HTTP packet at that time. at that time, you still have the opportunity to modify the HTTP header. If you just want to raise an error, see example 2 * // Example 2 echo ""; ob_flush (); # Output Buffer content flush (); # refresh the buffer, the function does not affect the cache mode of the server or client browser. Therefore, you must use both the ob_flush () and flush () functions to refresh the output buffer // We'll be outputting a response header ('Location: http://www.baidu.com ');?>

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.