Thanks, I was able to figure this out...although I don't know why it wasn't writing the initial record.
Code:
<?php
$ft_form_id = 49;
// validate the form...
if ( isset( $_POST['g-recaptcha-response'] ) ) {
$rules = array(); // validation rules
$rules[] = "required,first_name,Provide a first name.";
$rules[] = "required,last_name,Provide a last name.";
$rules[] = "required,phone,Please provide telephone or Skype contact info.";
$rules[] = "required,email,Provide an email address.";
$rules[] = "valid_email,email,Check the email address; it appears to be mistyped.";
$errors = validate_fields( $_POST, $rules );
// if there are no errors, process the form
if ( empty( $errors ) ) {
$fields = ft_api_init_form_page( $ft_form_id );
$params = array(
"submit_button" => "send",
"next_page" => "thanks.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form( $params );
$fields = array_merge( $fields, $_SESSION["form_tools_form"] );
} else {
$fields = array_merge( $fields, $_POST );
}
}
Pretty standard, except I'm using an invisible recaptcha.
SO, to get past the error, I had to insert a blank, unfinalized record into the database, using the same ID as noted in the 305 error message. With that, the form writes the data to that record and it's done. After that, it just worked.