All Projects → shevabam → recaptcha

shevabam / recaptcha

Licence: GPL-2.0 license
Google reCAPTCHA v2 PHP class

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to recaptcha

react-recaptcha-x
a React reCAPTCHA version 3 and version 2 (checkbox) component in one.
Stars: ✭ 21 (-48.78%)
Mutual labels:  recaptcha, google-recaptcha, recaptchav2
Codeigniter-recaptcha
CodeIgniter library to use Google's reCAPTCHA V2
Stars: ✭ 25 (-39.02%)
Mutual labels:  recaptcha, google-recaptcha, recaptchav2
react-grecaptcha
React.js Google reCAPTCHA v2 integration component.
Stars: ✭ 52 (+26.83%)
Mutual labels:  recaptcha, google-recaptcha, recaptchav2
evileg-core
EVILEG Social Network Framework - Core (ESNF-C)
Stars: ✭ 17 (-58.54%)
Mutual labels:  recaptcha, google-recaptcha
AspNetCore-ReCAPTCHAv3
reCAPTCHA v3 Usage in Asp.Net Core MVC
Stars: ✭ 17 (-58.54%)
Mutual labels:  recaptcha, google-recaptcha
recaptcha2
Easy verifier for google reCAPTCHA version 2 for Node.js and Express.js
Stars: ✭ 48 (+17.07%)
Mutual labels:  recaptcha, google-recaptcha
reCAPTCHA
‼️ Google reCAPTCHA (security) for Nette Framework \ Forms
Stars: ✭ 35 (-14.63%)
Mutual labels:  recaptcha, google-recaptcha
gothic
🦇 Gothic is a user registration and authentication SWT/JWT microservice. It supports REST, gRPC, and gRPC Web API, reCAPTCHA & a variety of DBs with Gorm.
Stars: ✭ 65 (+58.54%)
Mutual labels:  recaptcha
netlify-forms-formik
📝 Netlify Forms with Formik and ReCaptcha
Stars: ✭ 33 (-19.51%)
Mutual labels:  recaptcha
Sitecore-Forms-Extensions
onelittlespark.bartverdonck.be/category/sitecore-forms-extensions/
Stars: ✭ 56 (+36.59%)
Mutual labels:  google-recaptcha
ReCaptcha-Asp-Net
Google ReCaptcha for Asp Net, simplified
Stars: ✭ 51 (+24.39%)
Mutual labels:  google-recaptcha
recaptcha-unpaid-labor
Make ReCaptcha's "I'm not a robot" text more accurate
Stars: ✭ 15 (-63.41%)
Mutual labels:  recaptcha
django-rest-framework-recaptcha
reCAPTCHA field for Django REST framework serializers
Stars: ✭ 24 (-41.46%)
Mutual labels:  recaptcha
CapMonsterCloud
a C# wrapper for CapMonster Cloud API
Stars: ✭ 17 (-58.54%)
Mutual labels:  recaptcha
react-native-recaptcha-that-works
⚛ A reCAPTCHA bridge for React Native that works (Android and iOS)
Stars: ✭ 90 (+119.51%)
Mutual labels:  recaptcha
wp-recaptcha-integration
WordPress reCaptcha integration supporting Ninja Forms and Contact Form 7
Stars: ✭ 50 (+21.95%)
Mutual labels:  recaptcha
captcha-solver
Library and CLI for automating captcha verification across multiple providers.
Stars: ✭ 101 (+146.34%)
Mutual labels:  recaptcha
simple-recaptcha-v3
🤖 This repository contains simple reCAPTCHA v3 integration for your Laravel application.
Stars: ✭ 25 (-39.02%)
Mutual labels:  recaptcha
m2.ReCaptcha
Magento2. Extension is integrate Google Recaptcha with your Magento2 store.
Stars: ✭ 31 (-24.39%)
Mutual labels:  recaptcha
am-i-human
自分が人間か不安になったときに使うページ
Stars: ✭ 68 (+65.85%)
Mutual labels:  recaptcha

reCAPTCHA

Installation

With Composer, add this line to your require section :

"phelium/recaptcha": "dev-master"

Then run composer update.

Initilization

require 'vendor/autoload.php';

use Phelium\Component\reCAPTCHA;

To initialize reCAPTCHA, you must provide your site key and your secret key.
There is two possible ways :

$reCAPTCHA = new reCAPTCHA('your site key', 'your secret key');

or

$reCAPTCHA = new reCAPTCHA();
$reCAPTCHA->setSiteKey('your site key');
$reCAPTCHA->setSecretKey('your secret key');

Usage

To generate the script tag, use :

$reCAPTCHA->getScript();

To generate the HTML block, use in your form :

$reCAPTCHA->getHtml();

Checking the server side, in your form validation script :

if ($reCAPTCHA->isValid($_POST['g-recaptcha-response']))
{
	// do whatever you want, the captcha is valid
}
else
{
	// Show errors
	var_dump($reCAPTCHA->getErrorCodes());
}

Customization

Theme

Several themes are available : light (default) or dark.

$reCAPTCHA->setTheme('dark');

Language

You can change the language of reCAPTCHA. Check https://developers.google.com/recaptcha/docs/language for more information.
By default, the language is automatically detected.

$reCAPTCHA->setLanguage('it');

Type

Several types are available : image (default) or audio.

$reCAPTCHA->setType('audio');

Size

Two sizes are available : normal (default) or compact.

$reCAPTCHA->setType('compact');

Full example

Here is an example :

<?php
require 'vendor/autoload.php';
use Phelium\Component\reCAPTCHA;

$reCAPTCHA = new reCAPTCHA('your site key', 'your secret key');
?>

<html>
<head>
    <title>reCAPTCHA example</title>
    <?php echo $reCAPTCHA->getScript(); ?>
</head>

<body>

<?php
if (isset($_POST['name']))
{
    var_dump($_POST);

    if ($reCAPTCHA->isValid($_POST['g-recaptcha-response']))
    {
        echo '<br>-- Captcha OK ! --<br>';
    }
}
?>

<form action="#" method="POST">
    <input type="text" name="name" placeholder="name">

    <?php echo $reCAPTCHA->getHtml(); ?>

    <input type="submit">
</form>

</body>
</html>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].