The effect of BOM header

Source: Internet
Author: User

The following error occurred at the time of Setcookie.

Cannot modify header information-headers already sent by ....

This error is very common, and if you output any text before Setcookie, you will have the error message. Because the page header require a number of files, a row of troubleshooting is very troublesome, so I add at the top of the page:

PLAIN TEXT
PHP:
ob_start();

Add code before Setcookie:

PLAIN TEXT
PHP:
ob_get_clean();
This is to get the content of the page output before Setcookie. After the page runs, the display outputs an empty string, which means that Setcookie has no output before.

Then with vim opened the source file, found vim has open bomb option, suspect therefore to code added a hidden string, closed:

Set Nobomb

Solve the problem.

What does the BOM mean?

The BOM is the abbreviation for "Byte Order Mark", which is used to mark the encoding of the file. Not all text-editing tools recognize BOM marks

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.