function pageEntry($inPath) { /** * 初始化类 */ $cap = new SCaptcha(); /** * 生成图片,返回验证码 */ $code = $cap->CreateImage(); /** * 检验验证码 */ if (SCaptcha::check($code)) { error_log(true); } else { error_log(false); } }
function pagecaptcha() { session_start(); $cap = new SCaptcha(); $code = $cap->CreateImage(); }
/** * 验证验证码 */ public function checkCatcha($s) { session_start(); $oSC = new SCaptcha(); return $oSC->check($s); }