tp3.0 验证码生成和使用

                    <div class="imt-right-inputs">
                        <input style="width: 292px; height: 32px;font-size:16px;resize: none;" id="vcode" name="txt" clos="60" rows="5" warp="virtual" />
                        <img src="/index.php/Api/verifyCode" style="width: 75px;margin-left: -4px;" class="verifyCode" onclick="this.src='/index.php/Api/verifyCode?id={$random}'" title="点击刷新验证码" />
                    </div>
    //生成验证码
    public function verifyCode(){
        @import('ORG.Util.Image');
        $image = new Image();
        $image::buildImageVerify();
    }
      $code = $_SESSION['verify'];
      if($code != md5(strtolower($_POST['code']))){
          echo $code;exit;
          self::Jsend(10001,'验证码错误');
      }
posted @ 2020-08-25 09:08  盘思动  阅读(154)  评论(0编辑  收藏  举报