Re: No Caching (Reloading Fresh Content)

From: Date: Tue, 13 Nov 2001 22:40:44 +0000
Subject: Re: No Caching (Reloading Fresh Content)
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-14307@lists.php.net to get a copy of this message
I read a bit of it, but it's still giving me trouble. I have the following short, test, PHP script: ------------------------------------ <? Header("Cache-control: private, no-cache"); Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Past date Header("Pragma: no-cache"); $link = mysql_connect("localhost","root","password"); $R = mysql_db_query("database","SELECT uid FROM users LIMIT 200"); $N = mysql_num_rows($R); ?> <FORM ACTION='<?=$PHP_SELF;?>' METHOD='POST'> Number of Users: <? print $N . " - $Step"; ?> <INPUT TYPE='Hidden' NAME='Step' VALUE='<? print $Step+1; ?>'> <INPUT TYPE='Submit'> </FORM> ------------------------------------ Now, I load that script up, which displays "Number of Users: " and a submit button. I click on the submit button, and then again on the next page and I basically see: "Number of Users: 200 - 3" and a submit button. Now, keeping the browser window open in the background, I go and edit the script, changing LIMIT 200 to LIMIT 100 so that it will return just 100 users. I save and then go back to my browser and click the Back button, but now I get an IE message saying that it cannot automatically resubmit the posted information. What I want is to have it re-query the database with this new LIMIT 100 query and return "Number of Users: 100 - 2" So at this point I have either the option of forcing the user to see the IE page and have them reload it, which works, or by allowing caching to go on. Any more thoughts? - Jonathan "Chris Boget" <Chris.Boget@wild.net> wrote in message news:4040BBE81A9AD411BD27009027887A7C042FC3@tiger.wild.net... > > How can I ensure that a specific page is never cached and ALWAYS gets > > processed every time it is viewed? Sometimes a viewer can hit his/her > > browser's Back button (such a hateful button), and get a cached version of > > > a dynamic page. I want this page's PHP code to be executed even if the > > visitor uses their Back button to get to the page. Any thoughts on how to > > do this? > > Check out the discussion on the following page: > > http://www.web-caching.com/forums/Forum1/HTML/000133.html > > Chris >

« previous php.db (#14307) next »