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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.