开发者

Value with # in query string does not receive full data

开发者 https://www.devze.com 2023-02-06 03:03 出处:网络
I have one url with one code. http://www.example.com/exam.php?id=rteter#443545 Now when I click this URL, the value of the id is rteter, means it returns me only portion of code before #.

I have one url with one code. http://www.example.com/exam.php?id=rteter#443545

Now when I click this URL, the value of the id is rteter, means it returns me only portion of code before #.

I have not sent the link with urlencode so please do not give that solutions. Links are already sent, is they any way by which I can get the full value in my开发者_如何学运维 php code?

Martha


The # character indicates the start of the fragment identifier and is handled client side. You need to represent it as %23 if you want it sent to the server.

If you are generating query string parameters programatically in PHP, use the urlencode function.


Check out this post on stackoverflow: Can I read the hash portion of the URL on my server-side application (PHP, Ruby, Python, etc.)?

It might cover your question.


use url quote

http://www.example.com/exam.php?id='rteter%23443545'

http://php.net/manual/en/function.urlencode.php

0

精彩评论

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