开发者

# in url getting ignored in php 5.2 [duplicate]

This question already has answers here: Can I read the hash portion of the URL on my server-side application (PHP, Ruby, Python, etc.)? 开发者_运维问答 (12 answers) Closed 8 years ago.

I have php 5.2. The # in the URL is getting ignored by PHP. Anyone knows why.

For example if the url is

=">http://localhost?a=b#=

I am only seeing a=b


The URL fragment is not sent to the server by the browser. If you want to include an actual "#" in the query string then you need to encode it as %23 first.


The # character has a special meaning in URLs.

http://localhost?a=b#test

causes the browser to load http://localhost?a=b and jump to the element with the id or name of "test". That part is never sent to the server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜