Forum Moderators: coopster

Message Too Old, No Replies

How to prevent duplicate posts in my guestbook?

         

someone

6:10 pm on Jan 18, 2006 (gmt 0)

10+ Year Member



I have a little form that people can post their messages, but there has been a lot of duplicate entries by people pressing the submit button twice or by hitting refresh. How do I prevent multiple posts of the same entry?

kamakaze

6:27 pm on Jan 18, 2006 (gmt 0)

10+ Year Member



I believe you should be able to set one of the fields to UNIQUE which should stop the duplicate entries.

jatar_k

6:31 pm on Jan 18, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could generate a key/id when the form is served and is passed in a hidden field. you can check the db for that key everytime someone submits your form, if it exists, no insert.