Public Function index () {
/*//Output Verification code
$Verify = new \think\verify ();
$Verify->entry ();
*/
/*//Multiple verification codes
Verification Code 1
$Verify = new \think\verify ();
$Verify->entry (1);
Verification Code 2
$Verify = new \think\verify ();
$Verify->entry (2);
*/
/*//Parameter settings used in two ways
Instantiating incoming parameters
$config = Array (
' FontSize ' = 30,//Captcha font size
' Length ' = 3,//Verify code digits
' Usenoise ' = false,//Turn off CAPTCHA clutter
);
$Verify = new \think\verify ($config);
$Verify->entry ();
*/
/*
Using dynamic settings
$Verify = new \think\verify ();
$Verify->fontsize = 30;
$Verify->length = 3;
$Verify->usenoise = false;
$Verify->entry ();
*/
/*
Verification Code Font
$Verify = new \think\verify ();
Captcha font using Thinkphp/library/think/verify/ttfs/5.ttf Fifth font (1~6)
$Verify->fontttf = ' 5.ttf ';
$Verify->entry ();
*/
/*//verification Code background image
$Verify = new \think\verify ();
Open the CAPTCHA background image function randomly use the picture below the THINKPHP/LIBRARY/THINK/VERIFY/BGS directory
$Verify->USEIMGBG = true;
$Verify->entry ();
*/
/*//Chinese Verification Code
$Verify = new \think\verify ();
CAPTCHA fonts use thinkphp/library/think/verify/ttfs/to automatically find the TTF for Chinese fonts
$Verify->usezh = true;
$Verify->entry ();
*/
/*/Cancel curve obfuscation
$Verify = new \think\verify ();
$Verify->usecurve = false;
$Verify->entry ();
*/
/*/Set Picture width height
$Verify = new \think\verify ();
$Verify->imagew = 200;
$Verify->imageh = 100;
$Verify->entry ();
*/
/*
Two types of specified CAPTCHA characters
Non-Chinese
$Verify = new \think\verify ();
Set the captcha character to be a pure number
$Verify->codeset = ' 0123456789 ';
$Verify->entry ();
*/
/*
Chinese
$Verify = new \think\verify ();
$Verify->usezh = true;
Setting CAPTCHA characters
$Verify->zhset = ' I'm going to do it when he's going to do it. Domestic one is a work on the annual order of the Ministry of the People can be out of the party into the discord has big this ';
$Verify->entry ();
*/
}
function in conjunction with functions for detection//(function functions)
Public Function test () {Verify that the input verification code is correct, $code the CAPTCHA string entered by the user
$code =i (' Get.code '); function Check_verify ($code, $id = ") {
Var_dump (Check_verify ($code)); $verify = new \think\verify ();
} return $verify->check ($code, $id);
}
thinkphp-Verification Code