$rst=$this->check_verify(I('post.yzm')); if($rst===false){ $this->error('验证码错误',U('Tpl/Login/index'),2); }
public function yzm(){ $Verify = new \Think\Verify(); $Verify->fontSize = 30; $Verify->length = 4; $Verify->useNoise = false; $Verify->entry(); } // 检测输入的验证码是否正确,$code为用户输入的验证码字符串 public function check_verify($code, $id = ''){ $verify = new \Think\Verify(); return $verify->check($code, $id); }
文章评论(0)