How can I prevent a form from being submitted more than once

I recently found a huge security problem with my PM system that allows users to send a message as much as they want with a for loop in the address bar. Someone put this into the address bar:javascript:for(x=0;x<10000;x++)...