One possibility would be to check if this user has posted data already
and ignore it if he/she has.
This is simple if you are taking form data and placing it inside of a
database. Not so simple if something else is being done... i.e. An
customer service email script.
I have a site, where users can purchase items. To do so they have to
fill in a signup form. Obivously we only want each user to have one
account, but double clicking submit would normally create a new
account for them, so here is what I do.
I check the "critical information" against the database, if it exists
I just ignore the input. It looks something like this.
$critical_info = $_POST['email'];
$query = "SELECT * from mytable WHERE email ='$critical_inf o'";
$result = mysql_query($qu ery);
if(!$result){
//Do whatever it is I need to do to sign this customer up
}else{
echo <<< EOF
Sorry but it appears you've already signed up!<br>
<a href= "mysite.com/lostpass.php">C lick here to retrieve your
password</a><br>
EOF;
}
So basically, if you are storing the information, just check to see if
you already have the information before accepting it. If yes ignore,
otherwise store.
I hope this helps.
"Alex Thomas" <al*********@mi ndspring.com> wrote in message news:<pi******* **********@news read2.news.atl. earthlink.net>. ..
This is my problem.
I want to submit a form to another page to process the data from said form.
Then the person can go on to another part of the site or another site
altogether. However If the person later clicks the <back button> enough
times they will arrive back at the page that processed the data the first
time and the same data will be processed again. How can I prevent this?
My first thought was to use a cookie and set it on submit of the form but I
have not been able to get that to work. Any suggestions?
-Alex