Jump to content

Preventing the reprocessing of $_POST data


arpowers

Recommended Posts

Hey guys!

 

I am creating a messaging system where I add a message to the DB through $_POST data.. I'm wondering how I can prevent the data from being resubmitted if the user refreshes the page?

 

any suggestions would be useful!

as always, thanks in advance:)

 

Andrew

Only way I have ever found it do this is a key checkout system. Basically, you have a checkout table, and when you give the user the form, you create a key for them in the table, and write it out in the form as a hidden input. When they submit the form, check and make sure the key they gave you is in the table. If it is, delete it and process the form, otherwise, they have to refresh the blank form to get a new key issued.

 

Little bit of a pain in the ass, works good though.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.