验证码为什么要加密?加密也就算了,为什么还在一次性失效的前题下加密?
找了半天也没找到解决好的解决方案。最后决定把自带的验证码验证拿出来用于ajax,二次验证照样过。$verify = new \Think\Verify();<br>
global $seKey;<br>
$seKey = $verify->seKey;<br>
function authcode($str){<br>
$key = substr(md5($GLOBALS['seKey']), 5, 8);<br>
$str = substr(md5($str), 8, 10);<br>
return md5($key . $str);<br>
}<br>
function check($code, $id = '') {<br>
$key = authcode($GLOBALS['seKey']).$id;<br>
// 验证码不能为空<br>
$secode = session($key);<br>
if(empty($code) || empty($secode)) {<br>
return false;<br>
}<br>
if(authcode(strtoupper($code)) == $secode['verify_code']) {<br>
return true;<br>
}<br>
return false;<br>
}<br>
if (check(I('verify'))) {<br>
$this->success('验证码正确', $_SERVER['HTTP_REFERER']);<br>
} else {<br>
$this->error('验证码错误', $_SERVER['HTTP_REFERER']);<br>
}
Q907999456
http://blog.xuanzeta.com
AD:真正免费,域名+虚机+企业邮箱=0元

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version
God-level code editing software (SublimeText3)