Flexible server-side form validation for PHP