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
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
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
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
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
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
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, 30 Jul 2005 10:54:16 -0300
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
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