Php class for html forms submission and validation