Well there are several ways, some better than others, thou I personaly just like to check the entire contents of the post against a database where I store the items and if a match comes up I allow the script to think it's a double post. This methood can be a bit slow if the database is on a remote server, but it is the most accurate. It is highly unlikely that there would be a real post done by the same person with the exact same data in it.
Another methood might be to create a hash value (MD5?) based off a random number (say the current unix time) and have that in the post form, and you store that hash value in the database, then you check that value whenever a post is made and if there is a duplicate value then it's most likely a dupicate. Thou this methood is prone to duplicate values so you may want to include the users IP number as well...
Yet another methood would be to check to see if a post had been made by the same IP within some amount of time (say 10seconds). Most likely they arn't able to go to another message and post that fast. You could use this methood with a database or even do this with cookies.
There are many other ways to handle this, but these are probably the 3 most basic and easy to implement ways.