The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (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.27 (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.27 (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.27 (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.27 (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.27 (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.27 (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.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Error Code: #101 - first form submission will not go through - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: Error Code: #101 - first form submission will not go through (/showthread.php?tid=1910)



Error Code: #101 - first form submission will not go through - mizison - Feb 22nd, 2012

AWESOME new features in FT! Mega props to you, Ben & the team!

I have a bit of a prob - and I apologize in advance if this seems rather amature, but I've searched through the forum and tried various suggestions to no avail.

I setup a new form via the api - however, when I attempt to submit a form I am getting a #101 error.

I removed the "initialize" parameter from the ft_api_init_form_page function:
$fields = ft_api_init_form_page(2); ... am I missing something...? I did add SS Validation and I suspect this may be where the issue lies.

Here is what i've got on the form page:

<?php
require_once("../../../formtools/global/api/api.php");
$fields = ft_api_init_form_page(2);

$errors = array();
if (isset($_POST['JoinNow']))
{
$rules = array();
$rules[] = "required,FirstName,Please enter your first name.";
$rules[] = "required,LastName,Please enter your last name.";
$rules[] = "required,Address1,Please enter your address.";
$rules[] = "required,City,Please enter a city.";
$rules[] = "required,State,Please select a state.";
$rules[] = "required,ZipCode,Please enter your zip code.";
$rules[] = "digits_only,ZipCode,Your zip code can only contain digits.";
$rules[] = "length=5,ZipCode,Your zip code must be 5 digits.";
$rules[] = "digits_only,AreaCode,Your area code can only contain digits.";
$rules[] = "length=3,AreaCode,Your area code must be 3 digits.";
$rules[] = "digits_only,PhoneNumber0,The phone prefix can only contain digits.";
$rules[] = "length=3,PhoneNumber0,The phone prefix must be 3 digits.";
$rules[] = "digits_only,PhoneNumber1,Your phone line can only contain digits.";
$rules[] = "length=4,PhoneNumber1,Your phone line must be 4 digits.";
$rules[] = "required,Email,Please enter your email address.";
$rules[] = "valid_email,Email,Please enter a valid email address.";
$rules[] = "required,AcctPwrd,Please enter a password.";
$rules[] = "same_as,AcctPwrd,VerifAcctPwrd,Please ensure the passwords you enter are the same.";
$rules[] = "required,SecretQuestion,Please enter a secret question.";
$rules[] = "required,SQAnswer,Please enter the answer to your secret question.";
$errors = validate_fields($_POST, $rules);

if (empty($errors))
{
$params = array(
"submit_button" => "JoinNow",
"next_page" => "success.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
}
else
{
$fields = array_merge($_SESSION["form_tools_form"], $_POST);
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>.......... html body here .....

Form action is posting to $_SERVER["PHP_SELF"]
Fields are being refilled - ex:
value="<?=htmlspecialchars($fields["FirstName"])?>"


Any assistance would be greatly appreciated!

PS. success.php (my thank you page) has the proper code in the header as well:

<?php
require_once("../../../formtools/global/api/api.php");
$fields = ft_api_init_form_page();
print_r($fields);
ft_api_clear_form_sessions();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>.............................



RE: Error Code: #101 - first form submission will not go through - mizison - Feb 23rd, 2012

Alright - so it turns out there was an error on the success.php page. Initially, i copy/pasted a client's thank you page since it is for the client and i'm keeping the branding the same. Their page is riddled with invalid code... so I started with a blank sheet of .php and was able to process the form just fine.

I think the error code is misleading though, because it referenced an attempt to reinitialize the form which has already been setup in FT - when in fact it was some unknown code/variable deep within layers of code that was causing the error. i never went back and checked what it was since that would most likely take me weeks. i'll just reconstruct from the new blank slate.

thought i'd share!