The PHPGET method transmits Chinese parameters, and PHP cannot receive

Source: Internet
Author: User
PHP fails to receive http: // 127.0.0.1/index. php? Admin & q = module/user/list & site_id = 50 & a = userinfo & realname = % D2 % FC % BD % A8 % C0 % A4

On a LINUX server, $ data ['realname'] = $ _ GET ['realname']; this method cannot obtain the realname parameter. there is no problem in local testing. please explain it !!


Reply to discussion (solution)

Var_dump ($ _ GET); // You can check the output data.

Thank you for your reply. slog ("user name:". $ data ['realname']);
I typed logs in a self-writing method, but the English parameters can be passed in and printed out. I suspect that Chinese characters cannot be typed on the linux server, it's okay to print the test log in the local windows environment. Is there any good suggestions?

header('Content-type: text/html;charset=GBK');echo urldecode('%D2%FC%BD%A8%C0%A4');
Yin Jiankun

header('Content-type: text/html;charset=GBK');echo urldecode('%D2%FC%BD%A8%C0%A4');
Yin Jiankun


++.

Header ('content-type: text/html; charset = gbk ');
Echo urldecode ('% D2 % FC % BD % A8 % C0 % A4 ');
In this section, the code is uploaded to the server and the local access to the server actually prints out my name.

Slog (mb_convert_encoding ("user name:". $ data ['realname'], "UTF-8", "GBK "));
Slog (mb_convert_encoding ("user email:". $ data ['e-mail '], "UTF-8", "GBK "));

Slog (mb_convert_encoding ("user name:". $ data ['realname'], "GBK", "UTF-8 "));
Slog (mb_convert_encoding ("user email:". $ data ['e-mail '], "GBK", "UTF-8 "));
It is estimated that the encoding format is not a problem. I cannot print the encoding format in this way. please explain it !!

The problem lies in the slog function. you cannot find the reason outside.

This is not the case. the slog is added because the PrePass parameter cannot be searched. you need to check whether all the English logs are displayed and Chinese characters cannot be found. now I want to remove slog, when all the code has not been changed, the passing of parameter search returns to normal again. sorry, sorry...

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.