//验证码 $luosimao_response=$_POST['luosimao_response']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://captcha.luosimao.com/api/site_verify"); curl_setopt($ch, CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_0 ); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 8); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_HTTPAUTH , CURLAUTH_BASIC); //curl_setopt($ch, CURLOPT_USERPWD , "api:{$appr[appid]}"); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, array('api_key' => "{$appr[appkey]}",'response' =>$luosimao_response)); $res = curl_exec( $ch ); curl_close( $ch ); //Array ( [error] => 0 [res] => success ) $res=json_decode($res,true); if($res['res']!='success')printerror2('验证码错误','/e/member/register/');
螺丝帽,帝国cms ,php服务器端,验证验证码是否正确。