Jump to content

Double submitting help?


Scropion

Recommended Posts

if your worried about random people hitting the button like 20 times to see what happens, then that seems ok using that session id (would have to store a variable in the session), make sure you use sessions with cookies rather than passed through the url.

 

But that wont stop hackers and crackers, for that go here.

 

That link takes ou to someone i recently advised on a very similar if not identical problem.

What I've done in the past is once the data is dealt with after the user hits submit, I've redirected to the same page using header().

eg.

if ($_POST['submitbutton']) {
  //handle data here - email, change database whatever
  header("Location: script.php?done=true");
  exit;
}

 

Let's say the script is called script.php I'm calling itself - checking for the presence of ?done=true in the URL using $_GET[]. If not there page acts as normal, if present thanks the user for using the form.

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.