skillaug/re-captcha

reCaptcha 2.0

安装: 7

依赖: 0

建议: 0

安全: 0

星星: 0

关注者: 1

分支: 0

开放问题: 0

类型:php

v1.0.0 2018-06-23 05:16 UTC

This package is auto-updated.

Last update: 2024-09-14 14:03:59 UTC


README

Google reCaptcha 2.0 for PHP

安装

composer require skillaug/re-captcha "1.0.0"

用法

$secret = 'YOUR_SECRET';

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

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

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