Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML Form posts twice after submitting
    text
    copied!<p><strong>Edit for solution:</strong></p> <p>I still don't know why it's doing the double entry, but for the time being I've done some hacks.</p> <p>I added a UID token to the form, generated an MD5 and stored it with the DB entry. The script does a check to see if entry already exists or not. If it does, it passes off the entry ID, if not it adds a new one, then passes off the ID for final confirmation message.</p> <p>The form was doubling even the UID luckily, so I was able to catch it doing that. If it was two different UID's, then I may have had problems, haha.</p> <p>I'd like points goto PeeHaa, because if anyone else finds this question, I want other people to also know that Post, Redirect and Get is a good coding practice. (Post to your inserting script, redirect away from the page to a confirmation page, and use GET to get values to show).</p> <p><strong>Previous content:</strong></p> <p>OK, this is pretty basic.</p> <p>I know it's been asked a bazillion times here already, but none of the existing questions are pertinent to my problem.</p> <p>Basic HTML form. No fancy jQuery or anything.</p> <pre><code>&lt;form id="attendee_confirm" class="regform" method="post" action="http://url.com/wip/events/register/?"&gt; &lt;input name="attendee[0][first_name]" value="Bruce"&gt; &lt;input name="attendee[0][last_name]" value="Wayne"&gt; &lt;input type="hidden" name="reg_form" value="true"&gt; &lt;input type="hidden" name="questions" value="true"&gt; &lt;input type="hidden" name="action" value="done_confirming"&gt; &lt;input type="hidden" name="event_id" value="1"&gt; &lt;input type="submit" name="mySubmit" id="mySubmit" value="Confirmed"&gt; &lt;input type="button" value=" &amp;lt;-- BACK " onclick="history.go(-1);return false;"&gt; &lt;/form&gt; </code></pre> <p>WHY is my form posting it's data twice?? I really don't understand this.</p> <p>This is a confirmation form. A user is brought here after filling out the first form, just to confirm the names.</p> <p>The first form works fine, and brings over the appropriate information. The second one is supposed to confirm and send the email/process.</p> <p>The form posts twice, and I only ever see the output from the 2nd attempt. I cannot get any output from the first one.</p> <p>Because of this, if I try adding Session Token "catches" to the form to try and catch duplicate entries, the first try is allowed through, but the user only sees the second catch.</p> <p>Is this perhaps a server problem? My server is running ModSecure (Which has been pissing me off lately), and I'm really frustrated. I'm getting double occupancy for my events when I shouldn't...</p> <p><strong>Edit info:</strong></p> <p>This happens on all browsers, so it is not browser specific.</p> <p>I've also tried setting the capture script to redirect after receiving information to process, but as I mentioned, the data is being sent by some invisible thing first, and the output seen by the user is actually the second data. Not the first set. Everything is still doubled. Owf..</p> <p>The server logs were a bust. It's happening in one post. I'm going to double check scripts that might run twice.....</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload