Aureole Posted October 8, 2007 Share Posted October 8, 2007 How can I stop a form submitting twice if the submit button is pressed more than once WITHOUT Javascript. I tried this: <?php if($queried == 0) { // Query goes here... $queried = 1; updatePostCount($_SESSION['mem_id']); header('Location: viewtopic.swr3?id='.$_GET['id'].''); } ?> I figured that would work but it doesn't... Quote Link to comment https://forums.phpfreaks.com/topic/72290-duplicate-form-submission/ Share on other sites More sharing options...
zq29 Posted October 9, 2007 Share Posted October 9, 2007 No, it wont, on resubmission, $queried is not set. You're looking at either Javascript, or not allowing a duplicate field in the database, i.e. if you're taking someones name, don't allow consecutive id's with exactly the same name. Quote Link to comment https://forums.phpfreaks.com/topic/72290-duplicate-form-submission/#findComment-365549 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.