PHP _GET不会使用URL动态更新

我正在尝试使用_GET方法动态获取查询参数。

我的功能看起来像这样:

var baseURL = "http://example.org";
// clears the last query params
history.pushState("", document.title, baseURL);
// retrieves the value from the HTML code
var value = document.getElementById('id').value;

// URL with updated query params
var updatedURL = document.URL + "?value=" + value;
// pushing the new URL without refreshing the page.
history.pushState("", document.title, updatedURL);

// URL looks something like this "http://example.org?value=1"

But when I try to use _GET['value'] to retrieve the value from the URL, it only gets the value the page initialized with and does not update dynamically, is there any way to retrieve this value without having to refresh the page?