The gods to help, how to solve this garbled problem

Source: Internet
Author: User
This is the previous section
Header ("Content-type:text/html;charset=utf-8");
?>






Username

Password


This is the Analog server section

Header ("Content-type:text/html;charset=utf-8");

$mysqli =new mysqli ("localhost", "root", "123456", "web");

$result = $mysqli->query ("select * from user where user= ' {$_post[" username "]} ');

if ($result->num_rows > 0) {
echo "User {$_post[" username "} already exists and cannot be used";
}else{
echo "User {$_post[" username "} does not exist and can be used";
}

In the browser appeared in Chinese garbled, how to solve it,,,,, thank you to the great God to help!!!!


Reply to discussion (solution)

Your server file is not UTF-8 encoded. Change to Utf-8 code should be able to.

Look at your PHP script file encoding format must be UTF8.

How do I set the server-side encoding?

Save as Utf-8 without BOM header format with editor.

should be the result of BOM header

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