The parameters received by the URL are garbled, but local requests are normal.

Source: Internet
Author: User
The parameters received by the URL are garbled, but the local post is normal. finally, cg20 edited http: // localhost/xs7k/search/author-long.html & nbsp; it is normal that URL rewriting corresponds to garbled parameters received by the URL, but local operations are normal.
At the end of this post, cg20 edited http: // localhost/xs7k/search/author-dragon .html at 22:54:57 on January 14 ,.
Here, the URL rewriting corresponds to xs7k/search/index. php? Type = $1 & key = $2
It is normal to obtain the key locally. Previously, bluehost was used normally.

On the server, it will not work at http://www.xs7k.com/search/author-long.html, such as this one.

Today, I switched to iis in china. if the number is only Chinese, an error occurs "?? "Shown in this way. Is there any solution.

Use $ _ REQUEST or $ _ GET.
------ Solution --------------------
$ Url = "http: // localhost/xs7k/search/". UrlEnCode ('author-long'). ". html ";
Encode the Chinese character before passing the $ url variable.
If urlencode is not encoded, you can use Base64_Encode. However, if Base64_Encode is used, you must use the corresponding decoding function to decode it. UrlEnCode is not so troublesome.
------ Solution --------------------
The character set is different when different browsers transmit Chinese characters. There are GBK, there are also UTF-8. Use urlencode.
------ Solution --------------------
In addition, I am talking about transmitting Chinese characters in the address bar.
------ Solution --------------------
Or the first floor method, you can directly obtain the converted value, such as php: alt = "urlencode ('long')" JS: attr (alt)
------ Solution --------------------
Reference:
This is the http: // localhost/xs7k/search/author-dragon .html

Location. href = '../search/'Your type.options?type.selectedindex}.value='-'your key.value='.html ';

If key. value is encoded here, PHP cannot be used here?
Try to output the key. vlaue value in the background

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.