htmlwebfan/nocaptcha
Composer 安装命令:
composer require htmlwebfan/nocaptcha
包简介
Generates and verifies a NoCaptcha field in forms HTML forms with PHP.
README 文档
README
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.
Install
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
Overview
- Configure NoCaptcha
- Display the nocaptcha filed on the form
- 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
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
// 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.
Security
If you discover any security related issues, please email nocaptcha@htmlwebfan.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
htmlwebfan/nocaptcha 适用场景与选型建议
htmlwebfan/nocaptcha 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 03 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「form」 「recaptcha」 「html」 「spam」 「antispam」 「robot」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 htmlwebfan/nocaptcha 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 htmlwebfan/nocaptcha 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 htmlwebfan/nocaptcha 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Client library for reCAPTCHA with proxy support, a free service that protects websites from spam and abuse.
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
A simple and easy to use Google ReCaptcha v3 package for Laravel
HTML and form generation
A Laravel Filament Forms slug field.
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-17