Hello,
How about this for a different method:
The php that displays the form writes an extra hidden field to the
form, containing a random string value. It also writes that random
string along with a timestamp to a database table, called say,
form_control. The form action sends to a separate php
If its a potentially long message you're storing, you can always create an MD5
sum during insertion, compare it to existing MD5 sums, and if they don't
match, there's not duplicates.
Just as an example, if you're inserting message and user data, first see if
there's duplicates:
if (!mysql_num
Thanks!
I had already dealt with the problem using unique key, as many others
suggested. However, the records (post your comment-type) doesn't have any
natural key, so I had to concotinate several long text strings, which isn't
nice.
Could you point me in the direction of any code examples for
Ryan Grange wrote:
> How well would this methodology deal with people who double-click on
> submit buttons?
Of course, second submit generates second POST.
For browser history that looks like user clicks "Back" and then clicks
any other link on a page.
Everything else depends from your applic
Alexander Veremyev wrote:
You could use next simple rules to avoid this problem:
1. Never change anything in your storage (database) by GET HTTP
request method.
2. Never prepare any Web page by POST method.
3. After Form is processed (with a POST method) use HTTP redirect to
corresponding G
You could use next simple rules to avoid this problem:
1. Never change anything in your storage (database) by GET HTTP request
method.
2. Never prepare any Web page by POST method.
3. After Form is processed (with a POST method) use HTTP redirect to
corresponding GET page which should produce
after entering the data, send the user to another (confirmation) page...then
you avoid the possiblity of duplicates
Bastien
From: Miles Thompson <[EMAIL PROTECTED]>
To: "Hallvard" <[EMAIL PROTECTED]>, php-db@lists.php.net
Subject: Re: [PHP-DB] Duplicate record
Date: Sat
Do a seek on the fields which cannot be duplicated; if there's a
hit reload the page with the appropriate error message, otherwise reload
the page with a success message.
Although I have not worked with AJAX, this would appear to be an excellent
spot to use it. Silently check after focus h
in my opinion you can do the following:
1) once the user submitted the form, redirect to a new page
OR
2) may have a unique column in database to avoid duplication like userid
etc.
With Best Wishes
Balwant Singh
INDO ASIAN FUSEGEAR LTD.
A-39, HOSIERY COMPLEX
PHASE
Would'nt the simplest just setting one of the rows as UNIQUE? Or you can add
one query that checks if one of the values already exists in the database.
Best regards,
Martin
-Original Message-
From: Hallvard [mailto:[EMAIL PROTECTED]
Sent: 30. juli 2005 12:17
To: php-db@lists.php.net
Subj
10 matches
Mail list logo