Re: Tryng To Prevent Caching on IE 5-6.0

From: Date: Sat, 08 Mar 2003 10:58:30 +0000
Subject: Re: Tryng To Prevent Caching on IE 5-6.0
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-138741@lists.php.net to get a copy of this message
Hi Kurst, I don't know whether what I'm about to pass on will be of any help, or close to solving your problem, but perhaps the idea might lead you somewhere. I was faced with a problem: As my index page loaded, I had to test to see whether 'cookies' were enabled, without resorting to javascript. The reason I had to check: without cookies, sessions wouldn't work properly. The user would not be aware of anything amiss, until he accessed something from the db -- then all forms were messed up. The solution I hit upon was to create a test schema that relied on two additional 'pages' been called. On the 'index' page, the main one I wanted displayed, (and the one called for by url), has a simple script at the beginning. I have found that the 'index' page is not cached since it must be processed through this two-page filter on every encounter with the url -- else it is re-directed. Maybe it will work for you, or you could adapt it to your needs?? (I'm only a one-year 'php-veteran from the trenches' :>) Code follows: Index page: <?php session_start(); ob_start(); ?> <?php if ($_SESSION['test'] == "") { $_SESSION['test'] = "1"; header("location: index-load.php"); } ?> Index-load page: <?php session_start(); ob_start(); ?> <?php if ($_SESSION['test'] == "1") { $_SESSION['test'] = "1"; session_write_close(); header("location: index.php"); } else { header("location: index-message.php"); } ?> Index-message page: <?php session_start(); ob_start(); ?> <?php switch ($_SESSION['test']): case "1": header(location: index.php") break; case "" $_SESSION['test'] = "1"; /* you can put whatever message, commands in here */ break; endswitch; ?> Hth, Andre On Saturday 08 March 2003 03:03 am, you wrote: > > -----Original Message----- > > From: Bryan Lipscy [mailto:x427279616e@monroe.net] > > Sent: Saturday, March 08, 2003 1:38 AM > > To: 'Kurst'; php-general@lists.php.net > > Subject: RE: [PHP] Tryng To Prevent Caching on IE 5-6.0 > > > > Try: header("Cache-control: private"); > > It's a very good suggestion and I thank you for it but IE is still caching > the data :(. > > For those people who are wondering - > I used almost ever variation of that cache control in the header > That includes: > The cache-control as the only command, added to my huge cache-control > statement, and put on it's own line. > > Anybody else have any suggestions or different ways? > > Thanks for the advice :) > I appreciate it!

« previous php.general (#138741) next »