The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
Unable to submit form using API - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: Installation (https://forums.formtools.org/forumdisplay.php?fid=4) +--- Thread: Unable to submit form using API (/showthread.php?tid=2228) |
Unable to submit form using API - icue - Oct 13th, 2012 Could someone please offer some advice as I just can't do a test submission using the API. I am using XAMPP as my server on a PC running Windows Vista. During the install, the only error I got was about MYSQL (MySQL client version: mysqlnd 5.0.8-dev), but I checked using phpMyAdmin and the Server version is 5.5.16 so I assumed it would be ok to ignore the error. As per the instructions, I have the following at the top of my page: <?php require_once("forms/formtools/global/api/api.php"); $fields = ft_api_init_form_page(11, "initialize"); $params = array( "submit_button" => "submit", "next_page" => "thank-you.php", "form_data" => $_POST, "file_data" => $_FILES, "finalize" => true ); ft_api_process_form($params); ?> My form has the following: <form name="testForm" id="testForm" action="<?php echo $_SERVER["PHP_SELF"]?>" method="post"> My thank-you page has the following at the top of the page: <?php require_once("forms/formtools/global/api/api.php"); $fields = ft_api_init_form_page(); ft_api_clear_form_sessions(); ?> When I try to do a test submission, I get the following error: Error Type: User Error Code: #100 — Learn more about this error. The error say I could be sending an incorrect form ID so I checked the admin panel and it appears the ID is correct ID Form Form Type Status Submissions 11 testForm External Incomplete COMPLETE If I use the Direct method by pointing the form to Form Tools it works ok but I need to use the API so I can do server-side validation for various fields. Could someone please help. RE: Unable to submit form using API - mrGarvin - Nov 1st, 2012 It seems you´ve already set this up. Are all the fields in place in the database? If so, you no longer need to Initialize a new form in to the system. Try removing initialize from line 2, like this: $fields = ft_api_init_form_page(11); RE: Unable to submit form using API - icue - Nov 9th, 2012 Hi mrGarvin, Thank you for replying, i've been away hence the delay in responding. I don't know why but if I comment out the "next_page" => "thank-you.php", line I can send a test submission. Once the form is formalized, I can remove the "initialize" from $fields = ft_api_init_form_page(11); and then remove the comments from "next_page" => "thank-you.php" and everything appears to be ok. |