Skip to content

Commit

Permalink
change readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandowobeto committed May 22, 2021
1 parent ddc8c8e commit b0baa1c
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,34 @@
Register a new site on https://www.google.com/recaptcha/admin

Include the follow script to your site
```
```html
<script src="https://www.google.com/recaptcha/api.js?hl=pt-BR"></script>
```

Include the google div recaptcha inside form tag and the site key in the `data-sitekey attribute
```
```html
<div class="g-recaptcha" data-sitekey="site-key"></div>
```

PHP server use:
```php
<?php

include 'vendor/autoload.php';

use Wobeto\GoogleRecaptchaCheckbox\Recaptcha;

try {
$secret = '4Lchd-IvAAeAAIWBvzYvAEKu1chTimd0HJroP9T4';

$recaptcha = new Recaptcha($secret);

$verify = $recaptcha->verify($_POST['g-recaptcha-response']);

var_dump($verify); //true
} catch (Exception $e) {
echo $e->getMessage();
}
```

Enjoy...

0 comments on commit b0baa1c

Please sign in to comment.