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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php load/refresh question

Status
Not open for further replies.

mikedaruke

Technical User
Mar 14, 2005
199
US
I have a php page that reads content from a CSV file and comes up with all these caluations, etc.

The CSV file is updated like every 30 mintues.

When I got to the php page, I get stale data unless I hit refresh. People of course forget to refresh then come calling why is the data wrong.

How can I force the browser to refresh the page once they go to it? So I dont ever want to use a cached version.

I am not looking to have it refresh by itself every 5 seconds. I only want it to refresh when its called. It has to come from the server not the browser.

 
set the no-cache and content-expire headers.
 
that's more an http question.

in php you set http headers using the header() function.

Code:
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top