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
/printthread.php 16 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
/printthread.php 16 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
/printthread.php 16 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
/printthread.php 16 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
/printthread.php 16 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
/printthread.php 16 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
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Numerical Order - 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: Numerical Order (/showthread.php?tid=494)



Numerical Order - ironclaw - Feb 4th, 2010

Hi Folks,

Looking for some help on this one. I'm using a HTML form with 8 fields directed at Form Tools as a backend. The fields are:

First Field - An Email Address field

Fields 2 - 7 are boxes (or drop downs) that are to accept numbers up within a certain range (1 to 99)

I'm trying to modify process.php in FormTools to do the following:

1) Check email isn't already in database and its valid (Simple @ symbol check), if not, reject form and redirect
2) Check all numbers are within the range, if not, reject form and redirect

3) Put numbers in numerical order regardless of which field they were entered in
4) Enter in SQL Database with FormTools

But my PHP really isn't up to the task. Any help or even a pointer would be great! Is modifying process.php the best way to do this, or perhaps could the form page be scripted in PHP to do this, then the info sent to process.php

Best Regards,

ironclaw


RE: Numerical Order - Ben - Feb 6th, 2010

Hey Ironclaw,

Probably the best approach would be to use the API for your form rather than using submitting the form directly to Form Tools' process.php page. If you have it configured, you don't need to re-add it via Form Tools admin UI, you can just edit your form to use the API instead.

The reason I'd suggest using the API is because of the following:

  1. You can add server-side validation to ensure the POST values are within range.
  2. You can utilize methods found in the API - namely the ft_api_check_submission_is_unique. You could use that to check the uniqueness of the email address.
  3. You can sort the numbers however you wish, prior to adding to the database.

So the API would really fit the ticket very well!

But yes, it does require dabbling in the PHP a little, which is unfortunate. But these tutorials should really help:

- Adding a single-page form with the API
- Adding server-side validation to your forms

Hope this info at least gets you on the right track -

Ben