Forum Moderators: coopster

Message Too Old, No Replies

Cached $ POST[]. Why?

How to avoid caching POST values

         

smagdy

5:40 pm on Jan 15, 2009 (gmt 0)

10+ Year Member



Hello,

I submit a form from PAGE A then it goes to PAGE B to make some checks then if all valid it displays msg in PAGE C

So when it reach PAGE C and you go back by back button, it goes to PAGE A, and since i am using no cache technique, so it displays refreshed page with new values as it should.

But when i submit it, then PAGE B reads the old submited POST value!

I need to do manual refresh in PAGE A so PAGE B reads the new values

All pages have this code in header:

<?
session_start();
header("Cache-control: private"); //IE 6 Fix
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . date("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-Type: text/html; charset=utf-8');
?>

So, how to avoid caching POST values?

Thanks in advance

smagdy

5:52 pm on Jan 15, 2009 (gmt 0)

10+ Year Member



By the way, when i go back to PAGE A by the back button and look at the source code, I find that it got the new refreshed values as it should, but submitting it still make PAGE B catch the previously submitted POST values!

smagdy

7:21 pm on Jan 15, 2009 (gmt 0)

10+ Year Member



Assigning random name to the <input> solved it.

Thanks anyways!