It is not converted to having a query part of the URL after the fragment is invalid.
RFC 3986 defines a URI that consists of the following parts:
foo://example.com:8042/over/there?name=ferret#nose \_/ \______________/\_________/ \_________/ \__/ | | | | | scheme authority path query fragment
Order cannot be changed. Consequently,
URL1: http://www.example.com/?query=
will be processed correctly, and
URL2: http://www.example.com/
will not. If we look at URL2 , IE will actually handle the URL correctly by detecting the fragment as #ajax_call?query= without a request. The fragment is always the last and never sent to the server .
IE will correctly encode the request component URL1 because it will detect it as a request.
As for decryption in PHP, %D2 and similarly are automatically decoded in the variable $_GET['query'] . The reason the $_GET variable was not properly populated was URL2 request in URL2 did not conform to the standard.
In addition, the last thing ... when executing '' == $_GET['query'] , this will be true only if your PHP script itself is encoded in UTF-8. Your text editor should be able to tell you the encoding of your file.
source share