Hi !
I need to code the following:
I've got a function that checks the content and length of form fields. It's supposed to return a value containing an errorstring. So far so good. Now for the hard part:
define ("ERR_NO_NAME","No name entered !");
define ("ERR_SHORT_NAME","Name must be at least 3 chars long !");
...
Now for my function:
/*************************************************/
/ Check length and content/
/*************************************************/
function check_valid($field_name,&$errorstring,$field_content,$min_field_length)
{
$errorstring ="";
if(trim($field_name)=="") echo "parameters missing: check_valid() in". _SELF;
$field_content=trim($field_content);
if(!$feld_content)
{
$errorstring=_ERR_NO_.strtoupper($field_name);
return 0;
}
return 1;
}
The part I'm interested in is getting the errorstring to contain the string that was defined by ERR_NO_NAME and not the string "ERR_NO_NAME" as is. Get what I mean ?
Thanks
Chris