Aureole Posted July 23, 2007 Share Posted July 23, 2007 Is there any way using PHP to make sure that once someone clicks Submit if they click it again it won't send the data twice? If not is there any alternative using Javascript or something? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 23, 2007 Share Posted July 23, 2007 I use this method, don't see any issue with it form.php <?php //Add this to form $rand = rand(0,10000); echo "<input type=\"hidden\" name=\"FormID\" Value=\"".$rand."\" />"; ?> processer.php <?php //At top if($_SESSION['submitted'] == "yes" && $_POST['FormID'] == $_SESSION['FormID']){ exit($_POST['FormID']."Has Been Submitted"); } //in processing part if(processed){ $_SESSION['submitted'] = "yes"; $_SESSION['FormID'] = $_POST['FormID']; ?> Quote Link to comment Share on other sites More sharing options...
Aureole Posted July 25, 2007 Author Share Posted July 25, 2007 Hmm...that looks like an interesting way to do it, thanks a lot. 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.