0

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

user210504
  • 1,749
  • 2
  • 17
  • 36

2 Answers2

4

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.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
1

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.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • Thanks, I completely missed it :). But the latest Facebook Connect optionally sends it across in some responses back to the client. Can there be a way for the client to know when it is present? – user210504 Sep 18 '11 at 18:46
  • side effect of using stackoverflow :) – user210504 Sep 18 '11 at 19:01