Page 1 of 1

Multiple Form Submission

Posted: Tue Jun 20, 2006 4:01 pm
by jonra
All,

I'm looking for a quick and dirty implementation of a 'no-multple submit' function using PHP. I know there's lots of JS stuff out there that does this, but I don't trust it as the only source of validation and my form is already using a lot of JS which is making it harder to even implement a JS stop-multple-submit function even if I was comforatable with JS.

Is there a way to do this using PHP?

Posted: Tue Jun 20, 2006 4:16 pm
by John Cartwright

Code: Select all

if (!empty($_POST['somevar']) && !isset($_SESSION['formFlag']))
{
    $_SESSION['formFlag'] = true;

   //process here
}
Set a flag when your form has been submitted :wink:

Posted: Tue Jun 20, 2006 4:18 pm
by jonra
edit: NM - Got it. Thanks a ton for the help - seems like I should have thought of such a simple solution, but that's the fun of code right :D