我有一个带一个代码的网址。 http://www.example.com/exam.php?id=rteter#443545
现在,当我点击此网址时,ID的值为 rteter ,表示它只返回#之前代码的一部分。
我没有使用urlencode发送链接,所以请不要提供该解决方案。链接已经发送,是否可以通过我的PHP代码获得全部价值?
马大
答案 0 :(得分:0)
#
字符表示片段标识符的开头,并在客户端处理。如果要将其发送到服务器,则需要将其表示为%23
。
如果要在PHP中以编程方式生成查询字符串参数,请使用urlencode函数。
答案 1 :(得分:0)
在stackoverflow上查看this post: Can I read the hash portion of the URL on my server-side application (PHP, Ruby, Python, etc.)?
它可能会涵盖您的问题。
答案 2 :(得分:0)
使用网址引用
http://www.example.com/exam.php?id='rteter%23443545'