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

前端 未结 2 808
生来不讨喜
生来不讨喜 2021-01-28 10:00

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

2条回答
  •  失恋的感觉
    2021-01-28 10:43

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

提交回复
热议问题