If it possible to test a function in an if then else statement and set the value of the return all at the same time?
In the below code example, check if function check_data returns an empty variable or not. And set whatever is returned to $ERROR.
You will see an IF statement I supplied, but that does not work.
Thanks.
function check_data($var)
{ if ( eregi ("[a-zA-Z0-9_-]+$",$var) and strlen($var) >=3 and strlen($var) <= 14 )
$error="";
else
$error="nvalid Password : Password must contain only letters and numbers and be at least 6-10 characters long.";
return($error);
}
if ($error=(check_data($_REQUEST[real_name])!=""))