I have webpage A. The user clicks on a form to submit data, and it takes him to webpage B. When he clicks the back button, I need webpage A to be refreshed from the server, rather that loaded from cache. I have this: <meta http-equiv="expires" content="0"> but it doesnt seem to work. I have also tried setting a variable on page B (session variable via php) and then check for it on page A and refresh (or not) according to its existence. This doest seem to work either. The basic code for that is:
Page A:
<?php
if(isset($_SESSION['reloadPage'])) {
unset($_SESSION['reloadPage']);
echo'
<script>
window.location.replace("/****/****/*****.php");
</script>
';
}
?>
And on page B:
$_SESSION['reloadPage'] = 1;
With the PHP solution, it simply keeps trying to refresh the page in a never ending loop. Something in my logic missing? Is this the right way to go about it?
EDIT
Upon further investigation, when you tell the browser to not cache the page, does that force a full server side refresh as well? That’s what I need. A full server side refresh of the page.
OK try this instead:
You will need to set $_SESSION[‘form_submitted’] = true on page 2.