thinkphp use Get method to get Chinese parameter query no result solution _php Tutorial

Source: Internet
Author: User
When using thinkphp to do tags tags, there is a problem, is to get parameters, but can not find the corresponding results. View database discovery data is present. What's the problem?

Calls that are shaped like http:/www.xxxx.com/tags/index/%e8%87%aa%e5%8a%a8%e9%aa%8c%e8%af%81.html

The parameters are encoded by UrlEncode (), decoded using the UrlDecode () function, and the query still has no results.
Immediately after the test conversion code ICONV () function, the result was successful.

The default encoding for the browser is GB2312, and this project uses UTF-8 encoding.
Here is the wrong code and the revised code for everyone to see:

$kw = $_get[' _url_ ' [' 2 '];   The wrong code, the parameters that can be obtained on IIS, but the query does not produce the results. $kw = Iconv ("gb2312", "Utf-8", $_get[' _url_ ' [' 2 ']); After the code conversion, can query the results.

In addition, this method applies only to the IIS environment .
Also note that the$_get receive the parameters of the time itself has urldecode transcoding function, do not need to urldecode decoding operation!

http://www.bkjia.com/PHPjc/824775.html www.bkjia.com true http://www.bkjia.com/PHPjc/824775.html techarticle when using thinkphp to do tags tags, there is a problem, is to get parameters, but can not find the corresponding results. View database discovery data is present. What 's the problem?

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