I'm trying to reload a page using Javascript in my php code.
The page must be a fresh copy from the server.
I've tried the following:
1) Inserting a reload code in the code
echo "<script>
location.reload(true);
</script>";
Problem: this code keeps reloading the page.
2) Going back in the parent page:
echo "<script>window.location.href = document.referrer;</script>";
or
window.location.href = window.location.href;
Problem: this code does not get a fresh copy from the server, resulting in a outdated page.
Is there a way that i can reload (getting a fresh copy from the server) that runs only once, or get a parent, but updated page?
What am i missing here?