PHP class for building, validating and submitting data