The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
unfinalized forms - 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: unfinalized forms (/showthread.php?tid=2551) |
unfinalized forms - webfoundry - Aug 5th, 2013 Hi all, I'm new in this forum, and a new happy user of Form Tools. I read a lot of the tutorials, but one thing is not clear to me : I use validation (see code), but I get a lot of nulled out submissions in my database. Is there something wrong so submissions aren't validated properly, or is the submission not passed to the database in a proper way ? Some of the submissions are filled in, so not all of them are nulled. Some examples for the few hundred submissions wich seems nulled out : submission_id naam mail submission_date last_modified_date ip_address is_finalized confirmed 26 NULL NULL 2013-07-21 22:17:34 2013-07-21 22:17:34 xx.xxx.76.180 no NULL 27 NULL NULL 2013-07-22 00:55:38 2013-07-22 00:55:38 xxx.xxx.55.104 no NULL 28 NULL NULL 2013-07-22 02:26:08 2013-07-22 02:26:08 xxx.xxx.185.154 no NULL 29 NULL NULL 2013-07-22 04:08:41 2013-07-22 04:08:41 xxx.xx.32.133 no NULL 30 NULL NULL 2013-07-22 04:18:02 2013-07-22 04:18:02 xx.xxx.174.129 no NULL 31 NULL NULL 2013-07-22 04:53:32 2013-07-22 04:53:32 xxx.xx.102.159 no NULL 32 NULL NULL 2013-07-22 06:01:14 2013-07-22 06:01:14 xx.xxx.73.131 no NULL 33 NULL NULL 2013-07-22 08:51:26 2013-07-22 08:51:26 xx.xx.9.151 no NULL This is my php header: <?php require_once("../wedstrijdformulier/global/api/api.php"); $fields = ft_api_init_form_page(4); $errors = array(); if (isset($_POST["submit_button"])) { $rules = array(); $rules[] = "required,naam,don't forget to fill in your name."; $rules[] = "required,mail,don't forget to fill in your email."; $rules[] = "valid_email,mail,use a valid emailaddress."; $rules[] = "required,akkoord,you need to accept the conditions."; $errors = validate_fields($_POST, $rules); $criteria = array("mail" => $_POST["mail"]); if (!ft_api_check_submission_is_unique(4, $criteria, $fields["form_tools_submission_id"])) { $errors[] = "Sorry, this email already participated."; } // 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" => "thankyou.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); } } ?> P.S. : If I understand from http://forums.formtools.org/showthread.php?tid=1559&highlight=finalized it is normal to have a lot of unfinalized submissions in your database, so I guess I shouldn't worry. I just wanted to be sure as of 150 submissions in the form, only 7 of them are finalized, wich seems extremely low, wich makes me a little panicky. RE: unfinalized forms - Joe - Aug 5th, 2013 Unfinalized submissions in your database is normal. 7/150 submission does seem a bit on the low side. Do you have a multi-page form? Sometimes users that are halfway through submissions do not finish off filling out forms and just return at later time. Cheers, Joe RE: unfinalized forms - webfoundry - Aug 5th, 2013 Dear Joe, Thanks for your quick reply. Nope, it's even an extremely simple one-page form Form Tools is even overkill for this simple form, but it really DOES DELIVER what I need : record all the submissions in a database or csv file with a submission counter ! The form is a simple "enter the competition" with thankyou page: - name - confirmbox They all needed verification though as all the info is needed. I will keep on monitoring the submissions, but I guess it'll work. |