started PHP-side validation function