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 @   盘思动  阅读(161)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
历史上的今天:
2018-08-25 百度语音合成 composer
2017-08-25 火狐,discuz同步登录问题解决
点击右上角即可分享
微信分享提示