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? Link to comment https://forums.phpfreaks.com/topic/61306-solved-submit-once/ 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']; ?> Link to comment https://forums.phpfreaks.com/topic/61306-solved-submit-once/#findComment-305032 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. Link to comment https://forums.phpfreaks.com/topic/61306-solved-submit-once/#findComment-307363 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.