2017 © Pedro Peláez
 

library google-recaptcha

image

arrilot/google-recaptcha

  • Thursday, February 8, 2018
  • by Arrilot
  • Repository
  • 1 Watchers
  • 1 Stars
  • 51 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 325 % Grown

The README.md

Latest Stable Version Total Downloads Build Status, (*1)

Abstraction Layer for google reCAPTCHA 2

Installation

1) composer require arrilot/google-recaptcha, (*2)

2) Somewhere during bootstrap, (*3)

\Arrilot\GoogleRecaptcha\Recaptcha::getInstance()
    ->setPublicKey('6Lf1_...')
    ->setSecretKey('6Lf1_...')
    ->setLanguage('ru');

Usage example



 if (isset($_POST['g-recaptcha-response'])): ?>

    <h2>POST data</h2>
    <kbd><pre><? var_export($_POST); ?></pre></kbd>
    <? if (recaptcha()->verify()): ?>
        <h2 style="color:green">Success!</h2>
    <? else: ?>
        <h2 style="color:red">Something went wrong</h2>
        <pre><? var_export(recaptcha()->getErrors()); ?></pre>
    <? endif ?>

 else: ?>

    <p>Complete the reCAPTCHA then submit the form.</p>
    <form action="/captcha/index2.php" method="post">
        <fieldset>
            <legend>An example form</legend>
            <p>Example input A: <input type="text" name="ex-a" value="foo"></p>
            <p>Example input B: <input type="text" name="ex-b" value="bar"></p>

            <?= recaptcha()->getHtml(['size' => 'compact']) ?>
            <?= recaptcha()->getScript() ?>
            <p><input type="submit" value="Submit" /></p>
        </fieldset>
    </form>


The Versions

08/02 2018

dev-master

9999999-dev https://github.com/arrilot/google-recaptcha

  Sources   Download

MIT

The Requires

  • php >=5.6.9

 

by Nekrasov Ilya

recaptcha

08/02 2018

0.1

0.1.0.0 https://github.com/arrilot/google-recaptcha

  Sources   Download

MIT

The Requires

  • php >=5.6.9

 

by Nekrasov Ilya

recaptcha