PHP garbled code and Sessions verification solution! _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Tags ultraedit
PHP garbled code and Sessions verification solution !. When reading Chinese or other language characters in a PHP script is garbled, first check whether your file format is saved in UTF8 encoding format. If not, use UltraEdit... to read Chinese characters or other language characters in PHP scripts, first check whether your file format is saved in UTF8 encoding format. If not, use UltraEdit... and other tools that support UTF8 conversion, It is best not to use the MS Notepad to directly save it as a conversion. I made this mistake at the beginning.If you are editing in Dreamweaver, follow these steps: Edit - - -> Preferred parameters - - -"Create a document to set the language to UTF8 encoding.

About SESSION verification problems: At first my documents are written in GB2312, and then a website needs to use UTF-8 encoding, I put some of my files in the MS Notepad after opening, save as UTF-8 encoding, did not expect him to add a signature (BOM) in the script program file header so I directly converted the result is wrong:Cannot send session cookie-headers already sent...

After debugging for a long time, we found three solutions:

The first is to use Dreamweaver, UltraEdit... and other tools to convert the source files. this is the most fundamental solution;

The second is to add a "@" in front of the session_start () function.

The third is to open phpinfo () and check whether the parameter Output_buffering is no value. If yes, set it to 1.

Bytes. If not, use UltraEdit...

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.