/re-captcha

Primary LanguagePHPBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

reCaptcha

Google reCaptcha 2.0 for PHP

Installation

composer require skillaug/re-captcha "1.0.0"

Usage

$secret = 'YOUR_SECRET';

$reCaptcha = new \skillaug\reCaptcha( $secret );

$response = $reCaptcha->verifyResponse(@$_POST["g-recaptcha-response"]);

if ( empty( $response ) || $response->success === false ) {
    die('invalid captcha');
}