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



Form Tools
Missing Submission IDs and Error Code Question - 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: Missing Submission IDs and Error Code Question (/showthread.php?tid=1817)



Missing Submission IDs and Error Code Question - michatmaster7 - Dec 15th, 2011

I just noticed that when using the API to process forms via the POST method, the submissions in the database are skipping IDs. Is this because someone begins to fill out the form (creating a session), but then never clicks Submit?

Or is it because they are getting an error when they click submit? I'm a bit confused as to why some submission IDs are being skipped.

Somewhat related: the bit of code Ben always tells us to use in order to see error output I have found invaluable! But when that code outputs an error, can we have the output "DO" something?

1) On error output display, also display a custom message (for customers) letting them know there was a problem and that they should contact us.

2) Collect the error output and put it an email. The email would obviously go the FT install account admin (but this could also be customizable, I guess).

This would help in deciphering whether someone across the country (or in another country) is getting an error, what that error might be and then lets the admin know, so it can be addressed.


RE: Missing Submission IDs and Error Code Question - Ben - Dec 17th, 2011

Hey guys,

Quote:I just noticed that when using the API to process forms via the POST method, the submissions in the database are skipping IDs. Is this because someone begins to fill out the form (creating a session), but then never clicks Submit?

Exactly! Whenever anyone goes to your form, a unique ID is assigned to them right away. So even if they don't submit the form, that submission ID will never get used again. The skipped IDs are totally normal and aren't any cause for concern.

michat - the bit of code you mentioned, is that the $g_default_error_reporting setting?

You *can* customize the displaying and gathering of those errors through PHP, I believe, but it's kind of fussy. Instead, PHP usually logs that info automatically in its own error logs. For problems of this nature, searching the error logs is a much more elegant way to handle them. I often look through my own logs to find out the sort of problems that are occurring that I didn't know about. Maybe contact your hosting provider to find out where they're stored.

Good luck!

- Ben




RE: Missing Submission IDs and Error Code Question - michatmaster7 - Dec 17th, 2011

(Dec 17th, 2011, 1:10 PM)Ben Wrote: michat - the bit of code you mentioned, is that the $g_default_error_reporting setting?

Indeed, very handy!

(Dec 17th, 2011, 1:10 PM)Ben Wrote: You *can* customize the displaying and gathering of those errors through PHP, I believe, but it's kind of fussy. Instead, PHP usually logs that info automatically in its own error logs. For problems of this nature, searching the error logs is a much more elegant way to handle them. I often look through my own logs to find out the sort of problems that are occurring that I didn't know about. Maybe contact your hosting provider to find out where they're stored.

I briefly glanced at the error logs in cPanel, but didn't see any kind of PHP logs, I'll have to call them next week about that.

With the idea that PHP error logs exist on the server, I'm not so concerned about the error output doing anything special now. However, I WOULD like to have a message display on error output for customers. Something like, "Oops, we've encountered an error while processing your form, please contact us to finish your request." Or something. Something in text, standardized, that I can customize.

Would that be as easy as adding an echo script somewhere?


RE: Missing Submission IDs and Error Code Question - Ben - Dec 17th, 2011

Quote:However, I WOULD like to have a message display on error output for customers. Something like, "Oops, we've encountered an error while processing your form, please contact us to finish your request." Or something. Something in text, standardized, that I can customize.

I'm not sure about that. What kind of errors are you trying to catch? Actual major errors like the submission not being able to be added? With POST/Direct forms, your options are pretty limited.

But with the API, you can set the following setting to false in your global/config.php:

PHP Code:
$g_api_debug false

The API debugging is on by default, so whenever a problem occurs (like invalid form IDs being passed to the API functions), it displays the Form Tools error page with the appropriate error code for you to look up (see: http://docs.formtools.org/api/index.php?page=error_codes). When you set that variable to false, each function will *return* the errors instead of redirecting to the error pages. So for example, instead of calling:
PHP Code:
ft_api_process_form($params); 

You would call:
PHP Code:
list($success$error_code) = ft_api_process_form($params); 

It would behave in exactly the same way except when there was an error. In those cases, it would return false for $success, and the Form Tools API error code. You could do whatever you wanted with that info.

I *think* I standardized the return values for most the API functions, but you should probably test it out and tinker with the code.

Hope this helps!

- Ben