The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Successive form submissions by the same user overwrite eachother - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: Installation (https://forums.formtools.org/forumdisplay.php?fid=4) +--- Thread: Successive form submissions by the same user overwrite eachother (/showthread.php?tid=1479) |
Successive form submissions by the same user overwrite eachother - rrymrrsn - Jul 26th, 2011 Apologies if this has already been discussed. I couldn't find anything in the forum. The problem I am having is that successive form submissions by the same user overwrite eachother. I am using Formtools v2.0.5 (API) for collecting competition entries. I am using the PayPal IPN thing too, so the form submission doesn't get finalised until PayPal has reported back The form is at: http://ac-ca.org/pay/index.php It works fine for single competition entries but some people seem to want to enter themselves, then another person and possibly a third person. The first entry is currently overwritten in the formtools database by the subsequent entry. From the user's perspective everything seems to go swimmingly until they notice they have been emailed back with the same entry number several times. It is important that each entry is given the correct and unique Formtools submission ID and that every paid up entry is finalised in Formtools. Any pointers on how to tackle this would be great. Thanks Rry RE: Successive form submissions by the same user overwrite eachother - Joe - Jul 26th, 2011 Hi Rry, There are definitely some nuances when using Paypal (especially when you're using Paypal IPN). Have you reviewed the documentation for Paypal yet: http://docs.formtools.org/tutorials/paypal/?page=index It sounds like you're using the email (since the users continues to receive other emails with the same ID) to uniquely identify the submissoin, so if the user uses the same email for each entry the record is overwritten. You may need some additional information to uniquely identify the record or simply query the email to see if its in the database to prevent the same email from submitting more than once. Hope this helps. Cheers, Joe RE: Successive form submissions by the same user overwrite eachother - rrymrrsn - Jul 27th, 2011 Hi Joe, Thanks a lot for your reply. I have had a look through documentation again and found this, which refers to resetting form sessions to allow for resubmission: http://docs.formtools.org/api/?page=ft_api_clear_form_sessions I already had this PHP in my 'Thank you' page: PHP Code: <?php The submission ID gets sent to PayPal in the 'custom' variable to uniquely identify the transaction at that end: PHP Code: $fields["custom"] = $fields["form_tools_submission_id"]; Once the PayPal IPN script has finalised the form submission: PHP Code: // successful payment! finalize the submission in the database the submission ID just gets sent out in the FT triggered email labelled 'Entry number'. If anyone has any further ideas on this that would be great. Thanks Rry (Jul 26th, 2011, 4:37 PM)Joe Wrote: Hi Rry, RE: Successive form submissions by the same user overwrite eachother - Ben - Jul 28th, 2011 Hi Rry, Hmm! First off, yes the ft_api_clear_form_sessions() function is definitely necessary to clean the slate after a successful submission. But from what you described, it doesn't sound like it's doing its job... if they clicked back to the form the previous submission ID simply shouldn't be in memory any longer to be passed along to PayPal. Strange! Try this: on your first form page, after the ft_api_init_form_page call, add the following line. That will always output the contents of the current session - including whatever submission ID Form Tools thinks it has. PHP Code: print_r($fields); Then, put through a submission (in PayPal sandbox mode is best, of course), and try (a) returning to the form page by clicking on a link to the page, or manually entering the URL in your browser and (b) returning to the form page by navigating to the page via the "Back" button in your browser. Take a look at what's outputted in each case. Let me know how it goes! - Ben |