Is there anyway of detecting a duplicate form submit with PHP?
I have a textfield which is used for typing a one-word phrase into it (eg. "Google"). When the user presses the submit button, the form containing that textfield gets submitted. After that - on the PHP processing page - some data gets selected from a database. If the submitted word doesn't exist, it gets inserted in to the db. But if it already exists, the existing one gets a vote up. This might be a little complicated, but I think it is understandable.
The only problem is that when a user submits something like this: "Google." it gets submitted, although there is already a record that contains "Google".
My question is simple: How can I check for duplicates?
[I already tried out the mysql function: LIKE
, but it didn't really work, because when someone submitted something like this: "Goofy" it contained "Goo" in it which is already in the word "Google" -> which is already inserted. ]
So how could I solve this? Is there any good script for it?