vantolini/recaptcha

There is no license information available for the latest version (dev-master) of this package.

A tidied up version of ReCaptcha for PHP

This package's canonical repository appears to be gone and the package has been frozen as a result.

dev-master 2014-02-25 20:15 UTC

This package is not auto-updated.

Last update: 2019-04-29 04:17:52 UTC


README

A tidied up version of ReCaptcha for PHP

Show the captcha

echo ReCaptcha::recaptcha_get_html(PUBLIC_KEY);

Validate the captcha

$response = ReCaptcha::recaptcha_check_answer(
    PRIVATE_KEY, 
    $_SERVER['REMOTE_ADDR'], 
    $_REQUEST['challenge_field'], 
    $_REQUEST['response_field']
);

if (!$response->is_valid) {
    echo 'FAILED';
}else{
    echo 'OK';
}