Home  >  Article  >  Backend Development  >  登记时在服务器端应该做什么验证字段的合法性

登记时在服务器端应该做什么验证字段的合法性

WBOY
WBOYOriginal
2016-06-13 12:13:18970browse

注册时在服务器端应该做什么验证字段的合法性?
RT,表单的参数有username,password,email,只会在前端验证,但是觉得光用JS不靠谱
------解决思路----------------------
username,password:是否包含特定字符,如admin,最短(最长)多少个字符
email:是否是合法的email地址
插入数据库时再addslashes

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn