Multiple Form Submission

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jonra
Forum Newbie
Posts: 22
Joined: Thu May 25, 2006 9:35 am
Location: Iowa
Contact:

Multiple Form Submission

Post 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?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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:
jonra
Forum Newbie
Posts: 22
Joined: Thu May 25, 2006 9:35 am
Location: Iowa
Contact:

Post 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
Post Reply