An analysis of the header output problem of PHP headers function

Source: Internet
Author: User
 
 The header (' location:http://www.baidu.com '); * * But running the above discovery successful jump name is because this HTTP header does not conform to the HTTP specification, it is likely that the entire HTTP response will not be resolved. Fortunately, PHP seems to fix this HTTP header format problem for you. With regard to the first issue of HTTP headers, it is true that HTTP headers should not be output after HTTP content output. However, the server caches the output, although you use echo or print, but at that point the server does not export the content as an HTTP message, and you still have the opportunity to modify the HTTP header. If you simply want to cause a mistake, refer to Example 2*///2echo ""; Ob_flush (); #输出缓冲区中的内容flush (); #刷新缓冲区, the function does not affect the caching 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 pdfheader (' location:http://www.baidu.com '); >
  • 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.