codeboy89 Posted December 1, 2009 Share Posted December 1, 2009 I have a simple contact form, and a user could refresh and submit it several times, what is the best way to fix this with PHP? Quote Link to comment Share on other sites More sharing options...
Stuie_b Posted December 1, 2009 Share Posted December 1, 2009 Sessions would be my choice, would allow you to prevent multiple submitions with very little code changes stuie Quote Link to comment Share on other sites More sharing options...
Jnerocorp Posted December 1, 2009 Share Posted December 1, 2009 yea basically Stuie_b said use sessions <?php session_start(); // This starts the Sessions if(!isset($_SESSION['form'])) { // this checks if the session is set or not $_SESSION['form'] = "done"; // This sets the session // Place your form proccessing here } else { // If the Form is filled do the followin below echo "You have alredy Filled out the form"; // Displays the message if the form is already filled } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.