PHP code example of lptech-asia / lp-recaptcha
1. Go to this page and download the library: Download lptech-asia/lp-recaptcha library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lptech-asia / lp-recaptcha example snippets
$recaptcha = new LPRecaptcha('secret-key');
$tcha = new LPRecaptcha('secret-key');
$recaptcha->setSitekey('site-key');
if ($resp->isSuccess()) {
// Verified!
} else {
$errors = $resp->getErrorCodes();
}
$recaptcha = new LPRecaptcha('secret-key');
$resp = $recaptcha->setExpectedHostname('recaptcha-demo.appspot.com')
->setExpectedAction('homepage')
->setScoreThreshold(0.5)
->verify($gRecaptchaResponse);
if ($resp->isSuccess()) {
// Verified!
} else {
$errors = $resp->getErrorCodes();
}