src/Recaptcha/Captcha/Captcha.php
protected function process($parameters)
    {
        // Properly encode parameters
        $parameters = $this->encode($parameters);

        $request  = "POST /recaptcha/api/verify HTTP/1.0\r\n";
        $request .= "Host: " . self::VERIFY_SERVER . "\r\n";
        $request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
        $request .= "Content-Length: " . strlen($parameters) . "\r\n";
        $request .= "User-Agent: reCAPTCHA/PHP5\r\n";
        $request .= "\r\n";
        $request .= $parameters;

        if (false == ($socket = @fsockopen(self::VERIFY_SERVER, 80))) {
            throw new Exception('Could not open socket to: ' . self::VERIFY_SERVER);
        }

        fwrite($socket, $request);

        $response = '';

        while (!feof($socket) ) {
            $response .= fgets($socket, 1160);
        }

        fclose($socket);

        return explode("\r\n\r\n", $response, 2);
    }
protected function process($parameters)
    {
        // Properly encode parameters
        $parameters = $this->encode($parameters);

        $request  = "POST /recaptcha/api/verify HTTP/1.0\r\n";
        $request .= "Host: " . self::VERIFY_SERVER . "\r\n";
        $request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
        $request .= "Content-Length: " . strlen($parameters) . "\r\n";
        $request .= "User-Agent: reCAPTCHA/PHP5\r\n";
        $request .= "\r\n";
        $request .= $parameters;

        if (false == ($socket = @fsockopen(self::VERIFY_SERVER, 80))) {
            throw new Exception('Could not open socket to: ' . self::VERIFY_SERVER);
        }

        fwrite($socket, $request);

        $response = '';

        while (!feof($socket) ) {
            $response .= fgets($socket, 1160);
        }

        fclose($socket);

        return explode("\r\n\r\n", $response, 2);
    }
protected function process ( $ parameters ) { // Properly encode parameters $ parameters = $ this -> encode ( $ parameters ) ; $ request = "POST /recaptcha/api/verify HTTP/1.0\r\n" ; $ request .= "Host: " . self :: VERIFY_SERVER . "\r\n" ; $ request .= "Content-Type: application/x-www-form-urlencoded;\r\n" ; $ request .= "Content-Length: " . strlen ( $ parameters ) . "\r\n" ; $ request .= "User-Agent: reCAPTCHA/PHP5\r\n" ; $ request .= "\r\n" ; $ request .= $ parameters ; if ( false == ( $ socket = @ fsockopen ( self :: VERIFY_SERVER , 80 ) ) ) { throw new Exception ( 'Could not open socket to: ' . self :: VERIFY_SERVER ) ; } fwrite ( $ socket , $ request ) ; $ response = '' ; while ( ! feof ( $ socket ) ) { $ response .= fgets ( $ socket , 1160 ) ; } fclose ( $ socket ) ; return explode ( "\r\n\r\n" , $ response , 2 ) ; }
Make a signed validation request to reCaptcha's servers

@throws Exception
@param array $parameters
@return string
Make a signed validation request to reCaptcha s servers