1、获取验证码钩子
$captchadb = array( 'width'=>'80',//验证码宽度 'hegiht'=>'40',//验证码高度 'linenum'=>'',//干扰线数量,可留空 'dotnum'=>'',//干扰点数量,可留空 'bgcolor'=>'#ffffff',//验证码背景颜色 'type'=>'dot',//dot点,number为数字 ); $captchaimg = hook('captcha','show',$captchadb);
2、验证码验证钩子
$captchadb = array( 'captcha'=>'验证码的值', ); $checkcaptcha = hook('captcha','check',$captchadb);//错误返回false,正确返回true