lefuturiste / recaptcha_poo
This package is abandoned and no longer maintained.
The author suggests using the google/recaptcha package instead.
There is no license information available for the latest version (v1.0) of this package.
v1.0
2017-01-01 18:41 UTC
This package is auto-updated.
Last update: 2022-02-01 13:04:11 UTC
README
Use this class for have use Google recaptcha api. Use this class for your MVC architecture.
##Instalation
- Download this class.
##Usage
A - Server Instalation
- Require this class.
- Initialise class
<?php $captcha = new recaptcha('YOUR PUBLIC KEY GOOGLE API', 'YOUR SECRET KEY GOOGLE API'); ?>
- Verify if empty
$_POST['g-recaptcha-response']
key
<?php if (empty($_POST['g-recaptcha-response'])){ //error } else{ //continue script } ?>
- Verify api response
<?php if ($captcha->isSuccess($_POST['g-recaptcha-response']) == false) { //error } else { //successs } ?>
B - Client Instalation
- Include script's file :
<script type="text/javascript" src="https://cdn.stail.eu/jquery/jquery.min.js"></script> <script src='https://www.google.com/recaptcha/api.js'></script>
- Get html div :
$dataTheme = 'light'; //$dataTheme = 'dark'; <?= $captcha->getHtml($dataTheme) ?>
Light or Dark display posibility.