URL接收的参数乱码,但是当地是正常的
URL接收的参数乱码,但是本地是正常的
http://localhost/xs7k/search/author-龙.html 就是正常的
这里有URL重写对应的为xs7k/search/index.php?type=$1&key=$2
本地获取key就是正常的,以前用bluehost的主要也是正常的
服务器上就不行了http://www.xs7k.com/search/author-龙.html,如这个。
今天换成国内的了iis的,能数只要是中文的就出错"??"显示成这个样子,请问有没有什么办法解决。
用$_REQUEST或$_GET都一样的。
------解决方案--------------------
$url="http://localhost/xs7k/search/".UrlEnCode('author-龙').".html";
先把中文编码一下再传$url这个变量试试.
如果urlencode这个编码不行的话你就用Base64_Encode编码,,不过用Base64_Encode的话需要用对应的解码函数解码一下才行.UrlEnCode就没有那么麻烦了.
------解决方案--------------------
不同浏览器传输中文的时候,字符集不同。有GBK的,也有UTF-8的。用urlencode一下,会比较妥当。
------解决方案--------------------
补充,我说的是在地址栏传输中文。
------解决方案--------------------
还是1楼的方法,你就直接取值的时候取转换完的值,比如php:alt="urlencode('龙')"JS:attr(alt)
------解决方案--------------------

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The reasons why mysql cannot connect to localhost are that the mysql service is not started, the mysql port is occupied, and there is a problem with the MySQL configuration file. Detailed introduction: 1. In Windows systems, you can open the service manager by entering "services.msc" at the command prompt, then find the mysql service and ensure that its status is "Running". In Linux systems, you can use the "services.msc" command to check and control the service status; 2. You can use the open command and so on.

Solution: 1. Check the running status of the server and make sure it is listening on the correct port; 2. Try to temporarily disable the firewall or security software, and then try to access localhost again; 3. Check the hosts file of the operating system to ensure that localhost is resolved correctly ; 4. Try to restart the network adapter or reconfigure the network connection; 5. Try to change the port used by the local server, or close other programs that occupy the same port; 6. Try to manually add the corresponding IP address and domain name in the hosts file, etc.

linux localhost means "computer host name". The host name is used to identify an independent computer on the network; the root in "root@localhost" represents the currently logged-in user. In Linux, the administrator account is root, and the user is root. Log in to the Linux machine as a user.

PHP's urlencode() function: How to encode a string into a URL-safe format, specific code examples are needed. With the development of the Internet, URLs are widely used in daily life, and we often need to encode strings with some special characters into URL-safe formats. Format to pass parameters in the URL or request a web page. PHP provides the urlencode() function to accomplish this task. This article will introduce the usage of urlencode() function and give some specific code examples. 1. ur

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

In modern development, passing data through URLs is a common way. However, because the URL may contain some special characters, such as spaces, slashes, and question marks, these special characters will destroy the structure of the URL and cause data transmission to fail. In order to avoid this situation, PHP provides the urlencode function, which can encode the URL into a transportable format. The use of the urlencode function is very simple. Its syntax is as follows: stringurlencode(string

Introduction to PHP functions—urlencode(): Encoding URLs When developing web applications, you often encounter situations where URLs need to be encoded. URL encoding ensures that special characters in URLs are passed correctly, avoiding problems or incorrect results. In PHP, we can use the urlencode() function to perform URL encoding. The function of urlencode() function is to convert the string into an encoding format that conforms to the URL specification. It converts non-alphanumeric characters in a string to

According to news on January 31, TheBrowserCompany recently released a new application called ArcSearch, which makes full use of AI technology and aims to help users obtain the information they need more quickly and conveniently. The core feature of the ArcSearch application is its "Browseforme" function, which is powered by models from companies such as OpenAI. When a user searches, this function can automatically read at least six related web pages, integrate and summarize this information through AI technology, and finally display it to the user on a newly designed page. This page not only contains information related to the search keywords, but also divides the content into different parts to make it clearer for users.
