How can I get the value of the URL hash (eg "PARAMETERS"
in url "page.html#PARAMETERS"
) on the server in PHP?
Asked
Active
Viewed 472 times
0
-
3Doesn't anybody SEARCH anymore?! http://stackoverflow.com/questions/2317508/php-get-value-from-url-after-sign – Ignacio Vazquez-Abrams Feb 23 '10 at 14:30
-
possible duplicate of [How to get the value after the hash in "somepage.php#name"?](http://stackoverflow.com/questions/1917762/how-to-get-the-value-after-the-hash-in-somepage-phpname) – PhoneixS Jul 08 '15 at 09:39
2 Answers
8
You can't, at least not directly. The fragment identifier is never sent to the server.
You could extract it in JS using location.hash
and then trigger another HTTP request to the server that includes it as data (e.g. in the query string).

Quentin
- 914,110
- 126
- 1,211
- 1,335
4
You can't, unless you got something client-side to explicitly transfer it to you. The fragment part is only handled by the browser.

Joey
- 344,408
- 85
- 689
- 683