Usage of phpheader functions

Source: Internet
Author: User
Usage of phpheader functions

  1. If (true)
  2. {
  3. Header ('Location: http://bbs.it-home.org ');
  4. }
  5. File_put_contents('test.txt ',' OK '); // A test.txt file is generated, and the file content is OK.

In this code, careless programmers will think the header ('Location: http://bbs.it-home.org '); over, in fact, the background code is still executed, so use header (location) whether it is encapsulated in another function or written directly, we recommend that you add exit () to the end to confirm that the program is suspended.

>>> Articles you may be interested in: php header () simple example of a function php header function implements object download instance code example of header function usage in php detailed example of php header usage detailed instructions php header function file download directly prompts saved code php header information application example php file header) PHP header () function usage details HEADER messages in PHP

>>>

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.