src/BW/Captcha/Recaptcha.php
public function getHtml($error = null, $use_ssl = false) {
        if ( ! $this->getPublicKey()) {
            throw new \Exception('To use reCAPTCHA you must get an API key from <a href="https://www.google.com/recaptcha/admin/create">https://www.google.com/recaptcha/admin/create</a>');
        }

        if (true === $use_ssl) {
            $server = self::RECAPTCHA_API_SECURE_SERVER;
        } else {
            $server = self::RECAPTCHA_API_SERVER;
        }

        $errorpart = '';
        if ($error) {
            $errorpart = "&amp;error=" . $error;
        }

        return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $this->getPublicKey() . $errorpart . '"></script>'. PHP_EOL
                .'<noscript>'. PHP_EOL
                .'    <iframe src="'. $server . '/noscript?k=' . $this->getPublicKey() . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>'. PHP_EOL
                .'    <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>'. PHP_EOL
                .'    <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>'. PHP_EOL
                .'</noscript>'. PHP_EOL;
    }
public function getHtml($error = null, $use_ssl = false) {
        if ( ! $this->getPublicKey()) {
            throw new \Exception('To use reCAPTCHA you must get an API key from <a href="https://www.google.com/recaptcha/admin/create">https://www.google.com/recaptcha/admin/create</a>');
        }

        if (true === $use_ssl) {
            $server = self::RECAPTCHA_API_SECURE_SERVER;
        } else {
            $server = self::RECAPTCHA_API_SERVER;
        }

        $errorpart = '';
        if ($error) {
            $errorpart = "&amp;error=" . $error;
        }

        return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $this->getPublicKey() . $errorpart . '"></script>'. PHP_EOL
                .'<noscript>'. PHP_EOL
                .'    <iframe src="'. $server . '/noscript?k=' . $this->getPublicKey() . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>'. PHP_EOL
                .'    <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>'. PHP_EOL
                .'    <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>'. PHP_EOL
                .'</noscript>'. PHP_EOL;
    }
public function getHtml ( $ error = null , $ use_ssl = false ) { if ( ! $ this -> getPublicKey ( ) ) { throw new \ Exception ( 'To use reCAPTCHA you must get an API key from <a href="https://www.google.com/recaptcha/admin/create">https://www.google.com/recaptcha/admin/create</a>' ) ; } if ( true === $ use_ssl ) { $ server = self :: RECAPTCHA_API_SECURE_SERVER ; } else { $ server = self :: RECAPTCHA_API_SERVER ; } $ errorpart = '' ; if ( $ error ) { $ errorpart = "&amp;error=" . $ error ; } return '<script type="text/javascript" src="' . $ server . '/challenge?k=' . $ this -> getPublicKey ( ) . $ errorpart . '"></script>' . PHP_EOL . '<noscript>' . PHP_EOL . '    <iframe src="' . $ server . '/noscript?k=' . $ this -> getPublicKey ( ) . $ errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>' . PHP_EOL . '    <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>' . PHP_EOL . '    <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>' . PHP_EOL . '</noscript>' . PHP_EOL ; }
Gets the challenge HTML (javascript and non-javascript version).
This is called from the browser, and the resulting reCAPTCHA HTML widget
is embedded within the HTML form it was called from.

@param string $error The error given by reCAPTCHA (optional, default is null)
@param boolean $use_ssl Should the request be made over ssl? (optional, default is false)
@return string The HTML to be embedded in the user's form.
@throws \Exception
Gets the challenge HTML ( javascript and non - javascript version ) . This is called from the browser and the resulting reCAPTCHA HTML widget is embedded within the HTML form it was called from .