2017 © Pedro Peláez
 

library recaptcha_poo

image

lefuturiste/recaptcha_poo

  • Sunday, January 1, 2017
  • by lefuturiste
  • Repository
  • 0 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

recaptcha_poo

Use this class for have use Google recaptcha api. Use this class for your MVC architecture., (*1)

Instalation

  1. Download this class.

Usage

A - Server Instalation

  1. Require this class.
  2. Initialise class
  <?php
  $captcha = new recaptcha('YOUR PUBLIC KEY GOOGLE API', 'YOUR SECRET KEY GOOGLE API');
  ?>
  1. Verify if empty $_POST['g-recaptcha-response'] key
  <?php
  if (empty($_POST['g-recaptcha-response'])){
    //error
  }
  else{
    //continue script
  }
  ?>
  1. Verify api response
  <?php
  if ($captcha->isSuccess($_POST['g-recaptcha-response']) == false) {
      //error
  } else { 
    //successs
  }
  ?>

B - Client Instalation

  1. 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>
  1. Get html div :
  $dataTheme = 'light';
  //$dataTheme = 'dark';
  <?= $captcha->getHtml($dataTheme) ?>

Light or Dark display posibility., (*2)

The Versions

01/01 2017

dev-master

9999999-dev

  Sources   Download

by Avatar lefuturiste

01/01 2017

v1.0

1.0.0.0

  Sources   Download

by Avatar lefuturiste