dt614037527
dt614037527
2011-01-21 06:35

查询字符串中带#的值不会收到完整数据

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

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • dosi8657 dosi8657 10年前

    use url quote

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

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

    点赞 评论 复制链接分享
  • douliedai4838 douliedai4838 10年前
    点赞 评论 复制链接分享
  • doujianzhi3358 doujianzhi3358 10年前

    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.

    点赞 评论 复制链接分享