2017 © Pedro Peláez
 

library nocaptcha

Generates and verifies a NoCaptcha field in forms HTML forms with PHP.

image

htmlwebfan/nocaptcha

Generates and verifies a NoCaptcha field in forms HTML forms with PHP.

  • Tuesday, March 7, 2017
  • by htmlwebfan
  • Repository
  • 2 Watchers
  • 2 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

nocaptcha

Latest Version Software License, (*1)

Are you a robot? Introducing "No Captcha reCaptcha"., (*2)

This PHP package allows you to render a form field in a form and then verify the response from Google on your server. The package supports psr-4., (*3)

reCAPTCHA from Google, (*4)

Install

To get the latest version of nocaptcha simply require it in your composer.json file., (*5)

"htmlwebfan/nocaptcha": "dev-master", (*6)

You'll then need to run composer install to download it and have the autoloader updated., (*7)

Usage

Overview

  1. Configure NoCaptcha
  2. Display the nocaptcha filed on the form
  3. When the form is posted to your processor script, verify that the nocaptcha response is valid

Configure

Open the Config.php file and set the constants with the the sitekey and the secret values you got from Google Google, (*8)

Display

``` php, (*9)

// form_page.php, (*10)

// Instantiate a NoCaptcha object and initialize it with the Config // object containing your keys $nb = new NoCaptcha(new Config);, (*11)

// Generate the HTML code for your nocaptcha form field $nb->generateField();, (*12)

// When the user successfully completes the turing test, Google will set a // g-recaptcha-response on your form that will be posted to your processing script, (*13)


### Verify captcha from the server ``` php // processor_script.php // The value Google gave you on the form when the user completed the test $r = $_POST['g-recaptcha-response']; // Do not forget to filter your input here, I have not done so here in order // to keep the example simple $em = $_POST['email']; $nobot = new NoCaptcha(new Config); $nobot->setResponse($r); $v = $nobot->verify(); // verify() returns a stdCalss Object with a success property with a value of 1 // Any other value means the verification failed. The class has a debug() method // for troubleshooting failures like so: $nobot->debug()

Contributing

Please see CONTRIBUTING for details., (*14)

Security

If you discover any security related issues, please email nocaptcha@htmlwebfan.com instead of using the issue tracker., (*15)

Credits

License

The MIT License (MIT). Please see License File for more information., (*16)

The Versions

07/03 2017

dev-master

9999999-dev https://github.com/htmlwebfan/nocaptcha

Generates and verifies a NoCaptcha field in forms HTML forms with PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

form html spam recaptcha nocaptcha antispam robot turingtest spamprevention

12/07 2015

dev-stable

dev-stable https://github.com/htmlwebfan/nocaptcha

Generates and verifies a NoCaptcha field in forms HTML forms with PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

form html spam recaptcha nocaptcha antispam robot turingtest spamprevention

12/07 2015

v1.0.1

1.0.1.0 https://github.com/htmlwebfan/nocaptcha

Generates and verifies a NoCaptcha field in forms HTML forms with PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

form html spam recaptcha nocaptcha antispam robot turingtest spamprevention

02/07 2015

v1.0.0

1.0.0.0 https://github.com/htmlwebfan/nocaptcha

Generates and verifies a NoCaptcha field in forms HTML forms with PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

form html spam recaptcha nocaptcha antispam robot turingtest spamprevention