php - Issues related to url parameter transmission. There is a # sign in the parameter. Please come in quickly.
PHP中文网
PHP中文网 2017-05-16 13:07:34
0
4
707

There is a query function in the website
Query the content containing keyword parameters in the title of the article
I am currently encountering a rather embarrassing title
I want to check if there is any one that contains c# Article
url: article?keyword=c#
As you can imagine, when it is received by the server, it becomes keyword=c
How to solve this kind of problem?
Currently, it is not possible to modify URLs one by one across the entire site for escaping. Is there any way to perform actions in the existing <a> tags?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(4)
小葫芦

Use urlencode() 进行url编码转换,类似可以把 # 转化为 %23 , there is no need to submit it specifically for posts, Baidu also handles it this way

刘奇

It is a special character. The browser automatically truncates the # character and the value after it. You can transcode it before passing it, or submit it via post

滿天的星座
encodeURIComponent()
为情所困

Or transcode or directly change to characters recognized by other browsers.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template