简体   繁体   English

如何通过PHP获取page.html#PARAMETERS?

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

我怎样才能获得URL哈希值(例如值"PARAMETERS"中的URL "page.html#PARAMETERS" )在服务器上的PHP?

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 (eg in the query string). 您可以使用location.hash将其提取到JS中,然后向服务器发送另一个HTTP请求,将该请求作为数据包含在其中(例如,在查询字符串中)。

You can't, unless you got something client-side to explicitly transfer it to you. 除非您有一些客户端可以将其显式转让给您,否则您将无法这样做。 The fragment part is only handled by the browser. 片段部分仅由浏览器处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM