dapikk/ko7-recaptcha
最新稳定版本:1.1.1
Composer 安装命令:
composer require dapikk/ko7-recaptcha
包简介
Simple wrapper for Ko7even MVC for Google's reCAPTCHA library
README 文档
README
Simple wrapper for Google's reCAPTCHA library
A single class that allows you to add Google reCAPTCHA to your Ko7 forms. Code is very simple.
Installation
Direct download: Download the ZIP file and extract into your project. OR
composer require dapikk/ko7-recaptcha
Requires
- PHP => 7.4
- Ko7even => 3.3.8
- Google/reCaptcha => 1.3.0
Usage
- First obtain the appropriate keys for the type of reCAPTCHA you wish to integrate for v2 at https://www.google.com/recaptcha/admin
- Copy config from MODPATH/recaptcha/config/recaptcha.php to APPATH/config/recaptcha.php
- Make needed changes to configuration array!
- Activate recaptcha module in bootstrap!
To activate module:
Kohana::modules([ ... 'recaptcha' => MODPATH . 'recaptcha', ... ]);
To initialize reCaptcha check form on Your page:
<?php echo Recaptcha::instance()->get_html(); ?>
Or if multiple captchas are needed on same page then to provide some unique ID with request:
<?php echo Recaptcha::instance()->get_html('uniqueid12345'); ?>
To check verification from POST:
<?php $x = Recaptcha::instance()->check($_POST['g-recaptcha-response']); if($x == FALSE){ echo __('Please resubmit Google reCaptcha check!'); }else{ echo __('Recaptcha check succeeded!!!!'); } ?>
Config
recaptcha.php
return array( 'public_key' => 'YOUR GOOGLE RECAPTCHA SITE KEY', 'private_key' => 'YOUR GOOGLE RECAPTCHA SECRET KEY', 'version' => 'v2', //version required - recommended is to use v2 as it is more secure!!! 'rscore' => NULL, //Minimum score for safe actions, defaults to 0.5 and up - needed for Google reCaptcha version v3 'theme' => 'light', 'dlang' => 'en', 'dsize' => 'normal', );
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-18