PHP POST Submission Caching in Internet Explorer
Posted: Sun Jul 27, 2003 11:50 am
Hey Everyone,
I've got a problem, its a little difficult to explain. I've developed a system using OOP PHP. When you visit the page, it is called as something like this...
mydomain.com?script.php?action=whatever&form=data
Now, when the form is submitted, it is POSTED to itself, query string and all. Sounds pretty standard right, until this happens.
When you submit the form, you would expect to be able to hit the back button and it would return you to the previous menu with the fields, filled, possibly not, but you would still end up with the initial form on your screen. Well, in Internet Explorer 6 (Netscape it works fine, not sure about anything else), when you hit the back button it is the exact same page you just visited with the data submitted and the "Thank you" message, its really odd and quite annoying. When you hit back again, it takes you to the page BEFORE the form.
I've tried using the following code to prevent IE from caching the pages, but it hasn't stopped the problems.
I presume this has something to do with the way IE handles cached forms, but im not sure how to go around it. If anyone has any ideas, I'd really appreciate the help as I've been working with this problem for a long time now.
Regards,
Shawn
I've got a problem, its a little difficult to explain. I've developed a system using OOP PHP. When you visit the page, it is called as something like this...
mydomain.com?script.php?action=whatever&form=data
Now, when the form is submitted, it is POSTED to itself, query string and all. Sounds pretty standard right, until this happens.
When you submit the form, you would expect to be able to hit the back button and it would return you to the previous menu with the fields, filled, possibly not, but you would still end up with the initial form on your screen. Well, in Internet Explorer 6 (Netscape it works fine, not sure about anything else), when you hit the back button it is the exact same page you just visited with the data submitted and the "Thank you" message, its really odd and quite annoying. When you hit back again, it takes you to the page BEFORE the form.
I've tried using the following code to prevent IE from caching the pages, but it hasn't stopped the problems.
Code: Select all
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");Regards,
Shawn