TP5 验证码
发布日期:2021-05-04 09:23:05 浏览次数:15 分类:原创文章

本文共 392 字,大约阅读时间需要 1 分钟。

模版内验证码的显示

<div>{:captcha_img()}</div>

或者

<div><imgsrc="{:captcha_src()}"alt="captcha" /></div>


验证码配置文件路径:vendor\topthink\think-captcha\src\Captcha.php



点击验证码刷新:onClick="this.src='{:captcha_src()}?'+Math.random();"

<div class="code-img"><img src="{:captcha_src()}" alt="captcha" onClick="this.src='{:captcha_src()}?'+Math.random();" /></div>




官方文档:https://www.kancloud.cn/manual/thinkphp5/154295

上一篇:TP5 在模板读出Session值
下一篇:TP5 在JS中判断变量是为空(即在JS中写PHP代码)

发表评论

最新留言

网站不错 人气很旺了 加油
[***.192.178.218]2025年03月21日 11时55分32秒