Sessions PHP garbled and sessions verification problem solving Method!

Source: Internet
Author: User
Tags ultraedit
In the PHP script to read Chinese or other language is garbled, first check that your file format is stored in UTF8 encoding format. If not please use ultraedit ... And so on some of the tools to convert UTF8 support conversion, it is best not to use MS Notepad directly saved as a conversion, I began to make such a mistake. If you are editing in Dreamweaver, follow: Edit---Preferences---New Document Set the language to UTF8 encoding.

About the session validation problem: Initially My Documents were written in GB2312, and then a website needs to use UTF-8 encoding, I put some of my files in Ms Notepad opened, save as UTF-8 encoded, I didn't think he would add a signature (BOM) to the file header of the script, so I just converted the result is wrong: Cannot send session cookie-headers already sent by ...

Depressed debugging for a long time to find out three ways to solve:

The first kind is as mentioned earlier, the source of the file with Dreamweaver or UltraEdit ... And so on some of the UTF8 support conversion tools, this is the most fundamental solution;

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

The third is to open phpinfo (), to see if output_buffering this parameter is no value, is the word set to 1

The above describes the sessions PHP garbled and sessions verification problem solving Method! , including the content of the sessions, I hope to be interested in PHP tutorial friends helpful.

  • 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.