The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
Error 302 on the form - 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: Error 302 on the form (/showthread.php?tid=763) |
Error 302 on the form - congkai - Jun 28th, 2010 Hi people, i have a form that 1 person can submit many times. The first time submit is good and working prefectly. But the second time i get a ERROR Error Type: User Error Code: #302 — Learn more about this error. Debugging: Submission ID: 965 And when i click learn more about this error, i see The submission is already finalized! The ft_api_process_form only processes submissions that aren't finalized. You need to confirm that you are only finalizing the submission on the FINAL step of your form. See the documentation on ft_api_process_form form more information. I dont understand what does it say. so what should i do? ![]() oh this is my thank you page <?php require_once("/home/tuitionh/domains/domain.com/public_html/formtools/global/api/api.php"); $fields = ft_api_init_form_page(); $REFERER = getenv('HTTP_REFERER'); // get ref URL if ( $REFERER == 'http://domain.com/site/engagephp' || $REFERER == 'http://domain.com/site/engageatutorform4.php') { ft_api_clear_form_sessions("engage"); } elseif ( $REFERER == 'http://domain.com/site/beform4.php' || $REFERER == 'http://domain.com/site/beform4.php') { ft_api_clear_form_sessions("be"); } elseif ( $REFERER == 'http://domain.com/site/apply.php' || $REFERER == 'http://domain.com/site/applyt.php') { ft_api_clear_form_sessions("apply"); } elseif ( $REFERER == 'http://domain.com/site/contactus.php' || $REFERER == 'http://domain.com/site/contactus.php') { ft_api_clear_form_sessions("contactus"); } ?> where can i put in ft_api_process_form ? RE: Error 302 on the form - congkai - Jun 29th, 2010 can someone give me a respond or help me with this? i been waiting for the past 2 days RE: Error 302 on the form - congkai - Jul 4th, 2010 Can anyone pelase help me? RE: Error 302 on the form - Ben - Jul 4th, 2010 Hi congkai, Sorry for not being around! I've been scrambling to get another script into beta and had to drop the ball on this project for a while. Regarding your problem, what version of the API are you using? I thought I solved this by default in 1.0.0, but apparently not! If you're running an older version, I'd suggest upgrading. Alternatively, you can bypass the issue by explicitly telling the ft_api_process_form functions to allow it to update submissions that are already finalized (this is the default setting in 1.0.0). So on any page that calls that function, pass a new parameter like so: PHP Code: $params = array( However, in your case, since the person can submit the form multiple times you want to make sure that each time they're creating a NEW submission. As such, on the final page of your form make sure you're calling the ft_api_clear_form_sessions() function: http://docs.formtools.org/api/?page=ft_api_clear_form_sessions That will ensure that when they return to the first page they'll be putting through a brand new submission. Hope this helps...! - Ben RE: Error 302 on the form - congkai - Jul 4th, 2010 Hi ben. Arh! so happy you replied! thank god! Anyway nice work on formtools. WONDERFUL! My form tools is on v2.0.0-beta-2010010 My API is $g_api_version = "1.0.0-beta-20090908"; oh! so inserting ft_api_clear_form_sessions(); will solve the problem? This is my code.. I have already been using ft_api_clear_form_sessions("engage"); but it does not seems to help. The problem still lies. PHP Code: <?php (sorry if i flooded :p) anyway, i just updated my API from http://www.formtools.org/download_file.php?type=api&file=api1.0.1.zip&file_type=zip i guess its updated to 1.0.1 RE: Error 302 on the form - congkai - Jul 5th, 2010 ben, are you there? :p RE: Error 302 on the form - Ben - Jul 10th, 2010 Hey Congkai, Huh....! Well that actually looks fine to me. I think I'd need to look over the entire form and see it working on your server to figure out what was going on. But did you try just adding that "may_update_finalized_submissions" key to your $params? I'm almost positive that should fix it, though it's odd that it's still an issue with 1.0.1... - Ben |