Parameters received by the URL are garbled, but the local code is normal-php Tutorial

Source: Internet
Author: User
The URL is garbled, but the URL is the normal localhostxs7ksearchauthor-long.html. in this case, the URL rewriting corresponds to xs7ksearchindex. php? Type $1 & amp; key $2 it is normal to obtain the key locally. Previously, the parameters received by www.xs7k.com URLs were not available on the normal server, but they were normal locally.
Http: // localhost/xs7k/search/author-long.html is normal
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 --------------------
Discussion
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?

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.