Page 1 of 1

[SOLVED] Cache Refresh Problem - Simple?

Posted: Tue Aug 24, 2004 10:24 pm
by Subliminal
Hi Guys!

I have a bit of a problem on my hands...

I have a page that does a search for some items in MySQL and then prints the results.

Also on this page are buttons that the user can click. These buttons, among other things will insert information into the database to be printed when the page is loaded again (The First Step Mentioned Above)

The problems is whenever the user clicks the button and the page is processed (self processed) the items that appear from the MySQL search don't change unless you hit the reload button. After hitting the reload button the items that the user inserted to the database appear normally.

I have run into a similar problem in the past and was able to resolve it by adding:

Code: Select all

<?php
header('Pragma: no-cache'); 
header('Cache-Control: no-cache, must-revalidate');
?>
However this time that doesn't seem to work on this page

Thanks for your help...

Posted: Tue Aug 24, 2004 10:32 pm
by anjanesh
Have header() before any output starts in the browser.
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');

Posted: Tue Aug 24, 2004 10:51 pm
by feyd

Code: Select all

header('Expires: 0');
may help too :)

Posted: Wed Aug 25, 2004 6:30 pm
by Subliminal
Hey Guys,

Thanks but neither of those seem to work

I placed them at the very top of the page.
Goes something like this...

headers
some html containing the buttons to add things
the query and results
if isset that inputs the user results


GRRRRRRR I just realized my problem - I am calling the query first and then the input .... SIGH!!!!!!!!!!!!!

THANKS!