ThinkPHP学习笔记(十)在Model中完成自动验证前台的表单数据
index.html
UserModel.class.php
15||strlen($data)
display(); } function add(){ //经过自定义模型 $user=D('user'); if ($user->create()) { if ($user->add()){ $this->success("注册成功"); }else{ $this->error($user->getError()); } }else{ $this->error($user->getError()); } } } ?>