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.