Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing PHP

Status
Not open for further replies.

crazybeans128

Programmer
Aug 5, 2003
79
US
I am having a problem getting the PHP on a page to be refreshed every time it comes back to the users computer. I go to the page and it just reloads what was already sitting on the computer from visiting before, so i have to refresh the page to see the new information. How come this keeps happening, and what can i do to stop it?

 
google "php no cache header"

from
Code:
<?php
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
 
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

// HTTP/1.0
header("Pragma: no-cache");
?>

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
I'm not exactly sure what any of that means. a little bit of an explanation would be nice.

 
i'm telling you to google for "php no cache header", these are http headers to tell the browser not to cache the page

the example code is from the search result i referenced


-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top