Controller
Commit Confirm Public Function Logincl () {$verCode = Trim (I (' Post.vercode '));//Experience code if (! $this->check_verify ($verCod e) {die ("<script>alert", please refresh the certificate!) '); History.back ( -1);</script> "); }}//Verification Code Validation function check_verify ($code) {$verify = new \think\verify (); Return $verify->check ($code); }//Verification code generation-"Click on the image to replace the CAPTCHA function verify () {$config = array (' fontSize ' + 16,//test code size ' Le Ngth ' + 5,//Verify the number of digits ' usecurve ' and false,//close the code to the dot ' usecurve ' and false,); $Verify = new \think\verify ($config); $Verify->codeset = ' 0123456789 '; $Verify->entry (); }
Front Page
<tr>
<TD width= "42%" ><input name= "Vercode" id= "Vercode" type= "text" class= "Loginuser1" onclick= "JavaScript: This.value= ' "/> </td>
<TD width= "58%" > </td>
</tr>
thinkphp Verification Code