How can i get the page.html#PARAMETERS through PHP

2019-03-04 12:27发布

问题:

How can I get the value of the URL hash (eg "PARAMETERS" in url "page.html#PARAMETERS") on the server in PHP?

回答1:

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).



回答2:

You can't, unless you got something client-side to explicitly transfer it to you. The fragment part is only handled by the browser.



标签: php http