PHPackages                             htmlwebfan/nocaptcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. htmlwebfan/nocaptcha

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

htmlwebfan/nocaptcha
====================

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

v1.0.1(10y ago)228MITPHPPHP &gt;=5.3.0

Since Jul 2Pushed 9y ago2 watchersCompare

[ Source](https://github.com/htmlwebfan/nocaptcha)[ Packagist](https://packagist.org/packages/htmlwebfan/nocaptcha)[ Docs](https://github.com/htmlwebfan/nocaptcha)[ RSS](/packages/htmlwebfan-nocaptcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

nocaptcha
=========

[](#nocaptcha)

[![Latest Version](https://camo.githubusercontent.com/801c204805baed6fae1930c59d067bbad2b48956523c4497285848201edce0a5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f68746d6c77656266616e2f6e6f636170746368612e7376673f7374796c653d666c61742d737175617265)](https://github.com/htmlwebfan/nocaptcha/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Are you a robot? Introducing "No Captcha reCaptcha".

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.

[![reCAPTCHA from Google](https://camo.githubusercontent.com/f237cecf9327da1230978c1c20db31652c77bcc5f7f28c9967225d07602b2a8a/68747470733a2f2f7777772e676f6f676c652e636f6d2f7265636170746368612f696e74726f2f696d616765732f6865726f2d7265636170746368612d64656d6f2e676966)](https://www.google.com/recaptcha/intro/index.html)

Install
-------

[](#install)

- [Recaptcha on Packagist](https://packagist.org/packages/htmlwebfan/nocaptcha)
- [Recaptcha on GitHub](https://github.com/htmlwebfan/nocaptcha)

To get the latest version of nocaptcha simply require it in your `composer.json` file.

"htmlwebfan/nocaptcha": "dev-master"

You'll then need to run `composer install` to download it and have the autoloader updated.

Usage
-----

[](#usage)

### Overview

[](#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
---------

[](#configure)

Open the Config.php file and set the constants with the the sitekey and the secret values you got from Google [Google](https://www.google.com/recaptcha/intro/index.html)

### Display

[](#display)

```
// form_page.php

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

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

// 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
```

### Verify captcha from the server

[](#verify-captcha-from-the-server)

```
// 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
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Matthew Way](https://github.com/htmlwebfan)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Total

2

Last Release

3963d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a6537049eb4d4888b4eb583593d35a9d4407e84b95c7214c6fea429b1052ebd?d=identicon)[htmlwebfan](/maintainers/htmlwebfan)

---

Top Contributors

[![htmlwebfan](https://avatars.githubusercontent.com/u/8836899?v=4)](https://github.com/htmlwebfan "htmlwebfan (32 commits)")

---

Tags

htmlrecaptchaspamformnocaptchaantispamspampreventionrobotturingtest

### Embed Badge

![Health badge](/badges/htmlwebfan-nocaptcha/health.svg)

```
[![Health](https://phpackages.com/badges/htmlwebfan-nocaptcha/health.svg)](https://phpackages.com/packages/htmlwebfan-nocaptcha)
```

###  Alternatives

[karser/karser-recaptcha3-bundle

Google ReCAPTCHA v3 for Symfony

1862.4M7](/packages/karser-karser-recaptcha3-bundle)[form-manager/form-manager

PHP-HTML form manager

16041.0k7](/packages/form-manager-form-manager)[undefinedoffset/silverstripe-nocaptcha

A spam protector and form field using Google's reCAPTCHA v2 or optionally a foundation v3 implementation

33471.6k16](/packages/undefinedoffset-silverstripe-nocaptcha)[isometriks/spam-bundle

Provides spam protection for Symfony forms

46200.6k1](/packages/isometriks-spam-bundle)[aura/input

This package contains tools to describe and filter user inputs from an HTML form, including sub-forms/sub-fieldsets, fieldset collections, an interface for injecting custom filter systems, and CSRF protection. Note that this package does not include output functionality, although the "hints" provided by the Form object can be used with any presentation system to generate an HTML form.

6678.4k4](/packages/aura-input)[nucleos/antispam-bundle

This bundle provides some basic features to reduce spam in symfony forms.

52105.1k](/packages/nucleos-antispam-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
