Nov 1st, 2011, 10:48 AM
My PHP just isn't good enough to get it, I guess. I changed a rule to reflect the colon:
'required, email, email: An email field is mandatory'.
Then I added the following to the end of the list of rules:
I don't, however, understand adding a generic function to find and output a particular error message. I added the bit of code from your example, but it's obviously an undefined function, so it returned an error. It makes sense, but I don't understand PHP enough to know how to create the function (or define it).
'required, email, email: An email field is mandatory'.
Then I added the following to the end of the list of rules:
Code:
$raw_errors = validate_fields($_POST, $rules);
$error_hash = process_raw_errors($raw_errors);
I don't, however, understand adding a generic function to find and output a particular error message. I added the bit of code from your example, but it's obviously an undefined function, so it returned an error. It makes sense, but I don't understand PHP enough to know how to create the function (or define it).