new file:   lib/validate.php