orange08 Posted April 12, 2009 Share Posted April 12, 2009 hi, my php page if running in mozilla, when i press the 'back' button, i can get back to the previous page. but, for the same page for same situation, if running in IE, Warning: Page has Expired will occur... can i know what's the problem? can i control it with php code? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/153739-warning-page-has-expired/ Share on other sites More sharing options...
ILMV Posted April 12, 2009 Share Posted April 12, 2009 Are you posting data from a form to a script? Because if you are and you try to go back to that page IE may prevent your page from initially displaying, unless you confirm you want to post the data again. Quote Link to comment https://forums.phpfreaks.com/topic/153739-warning-page-has-expired/#findComment-807921 Share on other sites More sharing options...
orange08 Posted April 12, 2009 Author Share Posted April 12, 2009 Are you posting data from a form to a script? Because if you are and you try to go back to that page IE may prevent your page from initially displaying, unless you confirm you want to post the data again. yup, it's a form that will post data...so, you meant this is normal for IE and can't be prevent? when i refresh the page, then the data will be resend again... Quote Link to comment https://forums.phpfreaks.com/topic/153739-warning-page-has-expired/#findComment-807926 Share on other sites More sharing options...
premiso Posted April 12, 2009 Share Posted April 12, 2009 yup, it's a form that will post data...so, you meant this is normal for IE and can't be prevent? when i refresh the page, then the data will be resend again... To prevent it you can do a header redirect to a "thank you" page. Doing this redirect will clear the POST data. Quote Link to comment https://forums.phpfreaks.com/topic/153739-warning-page-has-expired/#findComment-807946 Share on other sites More sharing options...
orange08 Posted April 13, 2009 Author Share Posted April 13, 2009 yup, it's a form that will post data...so, you meant this is normal for IE and can't be prevent? when i refresh the page, then the data will be resend again... To prevent it you can do a header redirect to a "thank you" page. Doing this redirect will clear the POST data. ya, currently after the form is submitted, then it'll be redirect to the main page. my problem is sometimes user press the 'back' button, intend to get back the form again, that's why the problem arise... Quote Link to comment https://forums.phpfreaks.com/topic/153739-warning-page-has-expired/#findComment-808346 Share on other sites More sharing options...
premiso Posted April 13, 2009 Share Posted April 13, 2009 If you do a header redirect immediately after the form is submitted, it should wipe clean the data from POST. Something like this: <?php $action = isset($_GET['action'])?trim($_GET['action']):'index'; $action = strtolower($action); switch ($action) { case 'input': // enter data here header('Location: page.php?action=thanks'); break; case 'thanks': echo "Thank you for submitting data."; break; default: case 'index': echo 'Please fill out the form and click submit'; break; } ?> A simple example, but that should clear the post data for when a user clicks back. Quote Link to comment https://forums.phpfreaks.com/topic/153739-warning-page-has-expired/#findComment-808569 Share on other sites More sharing options...
orange08 Posted April 13, 2009 Author Share Posted April 13, 2009 If you do a header redirect immediately after the form is submitted, it should wipe clean the data from POST. Something like this: <?php $action = isset($_GET['action'])?trim($_GET['action']):'index'; $action = strtolower($action); switch ($action) { case 'input': // enter data here header('Location: page.php?action=thanks'); break; case 'thanks': echo "Thank you for submitting data."; break; default: case 'index': echo 'Please fill out the form and click submit'; break; } ?> A simple example, but that should clear the post data for when a user clicks back. please forgive my ignorant, may i know what $_GET['action'] meant? it's from my submit button? Quote Link to comment https://forums.phpfreaks.com/topic/153739-warning-page-has-expired/#findComment-808612 Share on other sites More sharing options...
premiso Posted April 13, 2009 Share Posted April 13, 2009 It was just a rough example. Basically it is a way to execute different code on the same page. It does not "have" to be setup that way. What I am getting at, is after your code processes from the submit button do an immediate header redirect and it should take care of the going back and re-posting the data. Quote Link to comment https://forums.phpfreaks.com/topic/153739-warning-page-has-expired/#findComment-808623 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.