Ajax issues. Online knot stickers.

Source: Internet
Author: User
Tags php foreach
I have a quick search function. But pass the test. Find the kanji I typed into the text box. is garbled. I used a function to convert it before. But forgetting that is the function again. I posted the approximate code. The great gods come and help me. Tokyu

                                        Select Supplier                                        
 
                                               
   >
                                           
 
                                       Quick Search for customers:                                                                            Select customer                                        
  
                                                 
     >
                                             
  
                                         





Reply to discussion (solution)

My userajax.php Code

 
  Connect ($db _config); $sql = ' Select Id,true_name from the users where User_type = 1 and true_name like '% '. $username. ' % "';//echo $sql; exit (); $rs = mysql_query ($sql); $html = ''; $html. = 'Please select customer '; while (@ $row =mysql_fetch_array ($rs)) {$html. = "". $row [' True_name '].";} $html. = ''; Echo $html;? >

First look at your page's character set encoding, keep the HTML page and PHP encoding consistent, should be the result of inconsistent coding

First look at your page's character set encoding, keep the HTML page and PHP encoding consistent, should be the result of inconsistent coding

It's been checked. It's all GBK. I've used a function to change it better than before. But I forgot it was the function.

String Iconv (String $in _charset, String $out _charset, String $str)

Thank you, I solved it.

$_post[' username ']=iconv ("UTF-8", "GBK", $_post["username"]);


I'm going to have to deal with Ajax like this.
  • 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.