Evert
Evert

Reputation: 99533

Browser remembers form state after a refresh. How to avoid?

Often times a browser will remember the form-state when the refresh button is hit. This is troublesome, because I actually want the updated database state to be shown when a user hits refresh.

Is there a way I can trick the browser to not remember the current form state?

Upvotes: 1

Views: 349

Answers (1)

benhowdle89
benhowdle89

Reputation: 37464

<?
//Set no caching
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?> 

Brute force!

Upvotes: 1

Related Questions