FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error 302 on the form
#1
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? Sad
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 ?
Reply
#2
can someone give me a respond or help me with this? i been waiting for the past 2 days
Reply
#3
Can anyone pelase help me?
Reply
#4
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(
  ...
  
"may_update_finalized_submissions" => true
  
...
);
ft_api_process_form($params); 

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_a...m_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
Reply
#5
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
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");
}
?>

(sorry if i flooded :p)
anyway, i just updated my API from http://www.formtools.org/download_file.p...e_type=zip

i guess its updated to 1.0.1
Reply
#6
ben, are you there? :p
Reply
#7
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)