double submitting
Posted: Sun Jun 10, 2012 7:54 am
Hello,
From time to time I found duplicated records (rows) in my database. Its looks like the user double click on the submit button.
recently its happen more often so I add code that check when the last submit happened (I save the linux time) and check if there is 10 second delay:
I don't know why but its not working.
is there any better way to prevent double submiting?
Roi.
From time to time I found duplicated records (rows) in my database. Its looks like the user double click on the submit button.
recently its happen more often so I add code that check when the last submit happened (I save the linux time) and check if there is 10 second delay:
Code: Select all
$query = mysql_query("SELECT create_date FROM `tkts_topics` WHERE (client = '$client') AND (email = '$email') AND (title = '$title') AND ($date - create_date <= 10) LIMIT 0,1");
if (mysql_num_rows($query))
{
}is there any better way to prevent double submiting?
Roi.