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
/showthread.php 26 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
/showthread.php 26 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
/showthread.php 26 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
/showthread.php 26 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
/showthread.php 26 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
/showthread.php 26 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
/showthread.php 137 forum_permissions
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key "mybb" - Line: 1952 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1952 errorHandler->error
/inc/functions_indicators.php 41 my_set_array_cookie
/showthread.php 629 mark_thread_read
Warning [2] Undefined property: MyLanguage::$ratings_update_error - Line: 5 - File: showthread.php(732) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(732) : eval()'d code 5 errorHandler->error
/showthread.php 732 eval
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_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1506 - File: showthread.php PHP 8.1.27 (Linux)
File Line Function
/showthread.php 1506 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 30 - File: showthread.php(1533) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 30 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $addremovesubscription - Line: 79 - File: showthread.php(1533) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 79 errorHandler->error
/showthread.php 1533 eval



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:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form submits data but 500 error after
#1
Hello,

I'm using an API form that was working fine until I tried to make some changes to the form code (a select field). The first time I tested the changes I got an Error 500, a now I keep getting the errors even after reverting the changes.

The form is able to store the information in the database but I don't get to the Thank you page or get the swift emails. The problem is only on one form. My other forms work well.

Another thing I noticed is that the session stays open since it never gets to the Thank you page so I have to manually load the Thank you page to close the session.

Any ideas would be greatly appreciated.

Here is my code:

<?php

require_once("../global/api/api.php");
$fields = ft_api_init_form_page("30"); // X would be your form ID

// validation time!

$errors = array();
if (isset($_POST['submit']))
{
$rules = array();
$rules[] = "required,first_name,01First Name is required.";
$rules[] = "required,last_name,02Last Name is required.";
$rules[] = "required,home_address,03Home Address is required.";
$rules[] = "required,city,47City is required.";
$rules[] = "required,zip_code,48Zipcode is required.";
$rules[] = "required,state,04State is required.";
$rules[] = "required,mobile_phone,05Mobile Phone is required.";
$rules[] = "required,email,06Email is required.";
$rules[] = "required,fullname,07Full Name is required.";
$rules[] = "required,place_birth,08Place of Birth is required.";
$rules[] = "required,nationality,09Nationality is required.";
$rules[] = "required,dob_mm,10Date of Birth is required.";
$rules[] = "required,dob_dd,11Date of Birth is required.";
$rules[] = "required,dob_yy,12Date of Birth is required.";
$rules[] = "required,gender,13Gender is required.";
$rules[] = "required,passport_number,14Passport Number is required.";
$rules[] = "required,place_issue,15Passport Place of Issue is required.";
$rules[] = "required,exp_mm,16Passport Expiration Date is required.";
$rules[] = "required,exp_dd,17Passport Expiration Date is required.";
$rules[] = "required,exp_yy,18Passport Expiration Date is required.";
$rules[] = "required,agent,19Agent is required.";
//$rules[] = "required,corp_card_year,50Expiration Date is required.";




$rules[] = "valid_email,email,30Please enter a valid email address.";

// $rules[] = "digits_only,zip_code,31Please enter a valid Zip Code.";
$rules[] = "digits_only,mobile_phone,32Please enter a valid Mobile Number";
$rules[] = "digits_only,home_phone,33Please enter a valid Home Number.";
$rules[] = "digits_only,work_phone,34Please enter a valid Work Number.";
$rules[] = "digits_only,cc1,35Please enter a valid Credit Card Number.";
$rules[] = "digits_only,cc2,36Please enter a valid Credit Card Number.";
$rules[] = "digits_only,cc3,37Please enter a valid Credit Card Number.";
$rules[] = "digits_only,cc4,38Please enter a valid Credit Card Number.";
$rules[] = "digits_only,cvc_code,39Please enter a valid CVC Code";
$rules[] = "digits_only,billing_zip,40Please enter a valid Zip Code.";
$rules[] = "digits_only,corp_cc1,41Please enter a valid Credit Card Number.";
$rules[] = "digits_only,corp_cc2,42Please enter a valid Credit Card Number.";
$rules[] = "digits_only,corp_cc3,43Please enter a valid Credit Card Number.";
$rules[] = "digits_only,corp_cc4,44Please enter a valid Credit Card Number.";
$rules[] = "digits_only,corp_card_cvc,45Please enter a valid CVC Number.";
$rules[] = "digits_only,corp_card_zip,46Please enter a valid Zip Code.";
$rules[] = "valid_email,assistant_email,49Please enter a valid email.";

$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",
"next_page" => "thanks.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
}
// it failed validation. Update $fields with the latest contents of the form data
else
{
$fields = array_merge($_SESSION["form_tools_form"], $_POST);
}
}
?>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)