tp3.2验证码

切换验证码

document.getElementById('img_code_1').src="__URL__/verify/"+Math.random(1,9999);

生成验证码

<img src="{:U('Home/User/verify',array())}" id="img_code_1"  style=" 120px;height: 42px;margin-left: 10px;">

 //验证码
    public function verify()
    {
        $Verify = new ThinkVerify();
        $Verify->entry();
    }
    //检验验证码
    function check_verify($code, $id = ''){
      $verify = new ThinkVerify();
      return $verify->check($code, $id);
    }

原文地址:https://www.cnblogs.com/phpwyl/p/8875974.html