protected function check($challengeField, $responseField) {
        
        $server = $this->request->server;
        
        $data = array(
            'privatekey' => $this->options['private_key'],
            'remoteip'   =>  $server->get('REMOTE_ADDR') ,
            'challenge'  => $challengeField,
            'response'   => $responseField     
        );
        
        $curl = curl_init($this->options['verify_url']);
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
        curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
        curl_setopt($curl, CURLOPT_USERAGENT, 'reCAPTCHA/PHP');
        curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
        curl_setopt($curl, CURLOPT_HEADER, true);
        $response = curl_exec($curl);

        $response = explode("\r\n\r\n", $response, 2);

        return (isset($response[1]) && preg_match('/true/', $response[1]));       
    }
protected function check($challengeField, $responseField) {
        
        $server = $this->request->server;
        
        $data = array(
            'privatekey' => $this->options['private_key'],
            'remoteip'   =>  $server->get('REMOTE_ADDR') ,
            'challenge'  => $challengeField,
            'response'   => $responseField     
        );
        
        $curl = curl_init($this->options['verify_url']);
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
        curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
        curl_setopt($curl, CURLOPT_USERAGENT, 'reCAPTCHA/PHP');
        curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
        curl_setopt($curl, CURLOPT_HEADER, true);
        $response = curl_exec($curl);

        $response = explode("\r\n\r\n", $response, 2);

        return (isset($response[1]) && preg_match('/true/', $response[1]));       
    }
protected function check ( $ challengeField , $ responseField ) { $ server = $ this -> request -> server ; $ data = array ( 'privatekey' => $ this -> options [ 'private_key' ] , 'remoteip' => $ server -> get ( 'REMOTE_ADDR' ) , 'challenge' => $ challengeField , 'response' => $ responseField ) ; $ curl = curl_init ( $ this -> options [ 'verify_url' ] ) ; curl_setopt ( $ curl , CURLOPT_POST , true ) ; curl_setopt ( $ curl , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ curl , CURLOPT_CONNECTTIMEOUT , 10 ) ; curl_setopt ( $ curl , CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_0 ) ; curl_setopt ( $ curl , CURLOPT_USERAGENT , 'reCAPTCHA/PHP' ) ; curl_setopt ( $ curl , CURLOPT_POSTFIELDS , $ data ) ; curl_setopt ( $ curl , CURLOPT_HEADER , true ) ; $ response = curl_exec ( $ curl ) ; $ response = explode ( "\r\n\r\n" , $ response , 2 ) ; return ( isset ( $ response [ 1 ] ) && preg_match ( '/true/' , $ response [ 1 ] ) ) ; }
Makes a request to recaptcha service and checks if recaptcha field is valid.

@param string $challengeField
@param string $responseField
@return boolean
Makes a request to recaptcha service and checks if recaptcha field is valid .