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 "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
Commas in error message (PHP Validation) [How-To] - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8)
+--- Forum: Form Validation: JS + PHP (https://forums.formtools.org/forumdisplay.php?fid=18)
+--- Thread: Commas in error message (PHP Validation) [How-To] (/showthread.php?tid=876)



Commas in error message (PHP Validation) [How-To] - Mike - Oct 3rd, 2010

Quote:Note: your error message cannot contain commas. This is currently a limitation of the script.

I don't like this limitation, because my language requires comma after "Please" Big Grin

I want to suggest a little fix in file \global\code\validation.php

If replace:
PHP Code:
function validate_fields($fields$rules)
{
  
$errors = array();

  
// loop through rules
  
for ($i=0$i<count($rules); $i++)
  {
    
// split row into component parts
    
$row split(","$rules[$i]); 

at:
PHP Code:
function validate_fields($fields$rules$splitter ",")
{
  
$errors = array();

  
// loop through rules
  
for ($i=0$i<count($rules); $i++)
  {
    
// split row into component parts
    
$row split($splitter$rules[$i]); 

nobody be affected, but everyone obtain possibility to use any character for separating components of $rules[] (I prefer the semicolon):
PHP Code:
$rules[] = "valid_email;email;Oh, no, you really think that it looks like the email?";
$errors validate_fields($_POST$rules";"); 
Wink