I had some stuff recently for a form I wanted a 'once only' usage.
It is quite hard.
Setting some Session cookies is one way, preventing using a back button as well like this which forces a reload rather than back I think:
A few snippets from the file might give you some ideas of where else to look (I haven't got the original links)
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");
header('Location: index.php'); //to redirect to another page or back to itself
<script type="text/javascript">
if (window.performance && window.performance.navigation.type == window.performance.navigation.TYPE_BACK_FORWARD) {
location.reload();
}
</script>
$cookie_value = "visited";
setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); // 86400 = 1 day
if(!isset($_COOKIE[$cookie_name])) {
// echo "Cookie named '" . $cookie_name . "' is not set!";
if (!isset ($_SESSION['formToken']) || $_POST['formToken'] !== $_SESSION['formToken'] ) {
$_SESSION['formToken'] = $_POST['formToken'];
/*continue form processing */
}