Hi, I have a form which when submitted adds a record to a DB. However if
the user clicks back it resubmits the same record.

I have tried using cache control to no avail :

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");
session_cache_limiter("nocache");

I also tried testing for the presence of a submit button so if the user
enters data submits the form and clicks back the page will refresh.

<?php 

if ($_POST['submit']) { 
echo "<META HTTP-EQUIV='refresh' CONTENT='0; URL=$PHP_SELF'>";
} else { 
} 
?>

The problem is I need to display a confirmation message after the user
submits, and with this technique the page always redisplays the (empty)
form after submission.

Any ideas?



Steve

Reply via email to