add php side validation, close #8