tp3.0 验证码生成和使用

                    <div class="imt-right-inputs">
                        <input style=" 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=" 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,'验证码错误');
      }
相信坚持的力量,日复一日的习惯.
原文地址:https://www.cnblogs.com/pansidong/p/13557820.html