The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/showthread.php 26 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/showthread.php 137 forum_permissions
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key "mybb" - Line: 1952 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1952 errorHandler->error
/inc/functions_indicators.php 41 my_set_array_cookie
/showthread.php 629 mark_thread_read
Warning [2] Trying to access array offset on value of type null - Line: 488 - File: inc/db_mysqli.php PHP 8.1.31 (Linux)
File Line Function
/inc/db_mysqli.php 488 errorHandler->error
/showthread.php 722 DB_MySQLi->fetch_field
Warning [2] Undefined property: MyLanguage::$ratings_update_error - Line: 5 - File: showthread.php(732) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(732) : eval()'d code 5 errorHandler->error
/showthread.php 732 eval
Warning [2] Undefined variable $postsdone - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Trying to access array offset on value of type null - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 7669 - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 7671 - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 7673 - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 7674 - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 7675 - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 7676 - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 7679 - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 7669 - Line: 1576 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
Warning [2] Undefined array key 7671 - Line: 1576 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
Warning [2] Undefined array key 7673 - Line: 1576 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
Warning [2] Undefined array key 7674 - Line: 1576 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
Warning [2] Undefined array key 7676 - Line: 1576 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
Warning [2] Undefined array key 7679 - Line: 1576 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 880 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 880 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 880 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 880 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 880 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1506 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1506 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 30 - File: showthread.php(1533) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 30 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $multipage - Line: 33 - File: showthread.php(1533) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 33 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $multipage - Line: 65 - File: showthread.php(1533) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 65 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $addremovesubscription - Line: 79 - File: showthread.php(1533) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 79 errorHandler->error
/showthread.php 1533 eval



FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some Demo Coded Pages would be nice
#6
So, I finally took this online and it WORKS! Even though my Test Email function on my localhost worked, apparently something in the FormTools configuration can't handle localhost email.

The localhost environment always sends emails correctly out to the internet but the Test Email function in FormTools Settings is apparently disconnected from the actual process for a Live External Form. Once I installed this ONLINE at a server then the form advanced to the "thank you" page!

NOW, I am trying to solve an API Form validation problem.

In a nutshell: As soon as I added PHP Validation rules into my form that specified that 3 of my fields had to have a length of 6 characters but no greater than 6 then the PHP errors returned IF any of those fields were NOT filled out.

But, I am not running a REQUIRED rule on those fields. I simply want any values, if entered, into those 3 fields to be no less than 6 characters in length and no more than 6 characters in length.

But this Rule is now making each of those fields REQUIRED on this form submission.

What the PHP should be saying as part of the rule is that "IF there is a Posted Value for this field then the Following Rule on Minimum and Maximum Length ought to be Applied ELSE this particular Rule does not run for this field".


Here is the script that is now Reporting an Error when No Value is Posted into the Guess1, Guess2, Guess3 field. It also contains a Login test script at the top.

PHP Code:
<?php
require_once("formtools/global/api/api.php");
$fields ft_api_init_form_page(1);
// validation time!
$errors = array();
if (isset(
$_POST['sendguess']))
{
$rules = array();
$rules[] = "required,email,Please enter your email address.";
$rules[] = "valid_email,email,Please enter a valid email address.";
$rules[] = "digits_only,guess1, Please only enter numbers with no commas.";
$rules[] = "length=6-7,guess1, No less or more than 6 numbers -- Guess 1 number is greater than 6 digits -- please keep your guess within 6 digits total.";
$rules[] = "digits_only,guess2, Please only enter numbers with no commas.";
$rules[] = "length=6-7,guess2, No less or more than 6 numbers -- Guess 2 is greater than 6 digits-- please keep your guess within 6 digits total.";
$rules[] = "digits_only,guess3, Please only enter numbers with no commas.";
$rules[] = "length=6-7,guess3, No less or more than 6 numbers -- Guess 3 is greater than 6 digits-- please keep your guess within 6 digits total.";
  
$errors validate_fields($_POST$rules);
 
  
// 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" => "sendguess",
  
"next_page" => "thanks.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);
  }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Vipcontest Guess Form</title>
</head>

<body>
<table width="85%" border="0" align="center" cellpadding="10">
  <tr>
    <th scope="col">&nbsp;</th>
    <th scope="col">&nbsp;</th>
  </tr>
  <tr>
    <td colspan="2"><form action="http://www.mywebsite.com/formtools/modules/submission_accounts/login.php" method="post">
  <input type="hidden" name="form_id" value="1" />
  <input type="hidden" name="invalid_login_redirect_url" value="http://www.mywebsite.com/loginfail.php" />
  Email <input type="text" name="username" /><br />
  Password <input type="text" name="password" /><br />
  <input type="submit" name="login" value="LOGIN" /><br />
  <a href="http://www.mywebsite.com/formtools/modules/submission_accounts/forget_password.php">Forget your password?</a><br />
</form></td>
  </tr>
   <tr>
    <th scope="col"><?php
// if $errors is not empty, the form must have failed one or more validation 
// tests. Loop through each and display them on the page for the user
if (!empty($errors))
{
  echo 
"<div class='error'>Please fix the following errors:\n<ul>";
  foreach (
$errors as $error)
    echo 
"<li>$error</li>\n";
 
  echo 
"</ul></div>"
}
?></th>
    <th scope="col">&nbsp;</th>
  </tr>
  <tr>
    <td colspan="2"><form name = "Vipcontest" id= "Vipcontest" action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
    <p>First Name
    <input name="fname" type="text" id="fname" value="<?=htmlspecialchars(@$fields["fname"])?>" />
  </p>
  <p>Last Name
    <input name="lname" type="text" id="lname" value="<?=htmlspecialchars(@$fields["lname"])?>" />
  </p>
  <p>City
    <input name="city" type="text" id="city" value="<?=htmlspecialchars(@$fields["city"])?>" />
  </p>
  <p>Email
    <input name="email" type="text" id="email" value="<?=htmlspecialchars(@$fields["email"])?>" />
  </p>
  <p>First Guess
    <input name="guess1" type="text" id="guess1" value="<?=htmlspecialchars(@$fields["guess1"])?>" />
  </p>
  <p>Second Guess
    <input name="guess2" type="text" id="guess2" value="<?=htmlspecialchars(@$fields["guess2"])?>" />
  </p>
  <p>Third Guess
    <input name="guess3" type="text" id="guess3" value="<?=htmlspecialchars(@$fields["guess3"])?>" />
  </p>
  <p>Password
    <input name="password" type="text" id="password" value="<?=htmlspecialchars(@$fields["password"])?>" />
  </p>
  <p>&nbsp;</p>
  <p>Submit
    <input type="submit" name="sendguess" id="sendguess" value="Submit" />

  </p>
</form>
    </td>
  </tr>
</table>


</body>
</html> 
Reply


Messages In This Thread
RE: Some Demo Coded Pages would be nice - by Question Guy - Jun 13th, 2012, 3:41 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)