The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Intermittent #305 failure - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Intermittent #305 failure (/showthread.php?tid=686)



Intermittent #305 failure - mr_twin - May 5th, 2010

Hello Smile
Since few weeks, I get an intermittent failure. Sometimes, after submitting the form a #305 Error, but I don't know why?!

Here is the link to my form:http://www.recht-auf-spiel.de/eure_projekte_eintragen_neu.php

And here is the code of the form page:
PHP Code:
<?php
require_once("formtools/global/api/api.php");
$fields ft_api_init_form_page(3);

// validation time!
$errors = array();
if (isset(
$_POST['submit_button']))
{
  
$rules = array();
  
$rules[] = "required,projekt_titel,Bitte Projekttitel angeben.";
  
$errors validate_fields($_POST$rules);
  
// no errors - great! Now we process the page. The ft_api_process_form does
  // the job of both updating the database and redirecting to the next page
  
if (empty($errors))
  {
$params = array(
  
"submit_button" => "submit_button",
  
"next_page" => "thanks.php",
  
"form_data" => $_POST,
  
"file_data" => $_FILES,
  
"finalize" => true
  
);
ft_api_process_form($params);
ft_api_delete_unfinalized_submissions(3true);
}
else 
  {
    
$fields array_merge($_SESSION["form_tools_form"], $_POST);
  }
}

?>

I try to delete the row with "ft_api_delete_unfinalized_submissions(3, true);" but without any result.

I think the error appears, when a user starts to fill out the form but go back with the backbutton in the browser and starts again.

Have you any idea to solve the problem?

Thank you very much and sorry for my bad english :/ Smile I hope you know what I mean Smile


RE: Intermittent #305 failure - Ben - May 8th, 2010

Hi Mr Twin,

Try changing this line:

PHP Code:
ft_api_delete_unfinalized_submissions(3true); 

to this:

PHP Code:
ft_api_delete_unfinalized_submissions(3false); 

The problem is that that second parameter of the function. If set to true, it deletes ALL unfinalized submissions in the database up to the very moment. This is generally a bad idea - if there are any unfinished forms currently being submitted those users will get the 305 error.

Hope this helps!

- Ben


RE: Intermittent #305 failure - mr_twin - May 10th, 2010

(May 8th, 2010, 10:24 AM)Ben Wrote: Hi Mr Twin,

Try changing this line:

PHP Code:
ft_api_delete_unfinalized_submissions(3true); 

to this:

PHP Code:
ft_api_delete_unfinalized_submissions(3false); 

The problem is that that second parameter of the function. If set to true, it deletes ALL unfinalized submissions in the database up to the very moment. This is generally a bad idea - if there are any unfinished forms currently being submitted those users will get the 305 error.

Hope this helps!

- Ben

Hi Ben,
thanks for your solution! I'll try this in few days and give you a feedback Smile

Greetings from germany