如何在php中获取使用pushState在历史中推送的url


How to get url in php which pushed in history using pushState

我使用historty.pushState(); 更改了浏览器url

window.history.pushState('data', null, entityUrl);

然后我只想在php函数中获取那个url。我正在使用$_SERVER['REQUEST_URI']全局变量,但没有得到修改后的url。

Plz帮助提前感谢!

window.history.pushState不会向服务器发送请求,因此您永远无法使用php获得url。

如果你需要它,你可以考虑向服务器发送一个ajax请求,只是告诉它url