Download the PHP package helsingborg-stad/recaptcha-integration without Composer
On this page you can find all versions of the php package helsingborg-stad/recaptcha-integration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download helsingborg-stad/recaptcha-integration
More information about helsingborg-stad/recaptcha-integration
Files in helsingborg-stad/recaptcha-integration
Package recaptcha-integration
Short Description Google ReCAPTCHA v3 integration for Municipio and plugins
License MIT
Informations about the package recaptcha-integration
recaptcha-integration
Google ReCAPTCHA v3 integration for Municipio and plugins
Install with Composer
Howto:
Start with the essentials required to use the package.
Markup for Front End (HTML):
Add hidden input to your form. Google will populate the input with a hashed string.
Keys for Back End (PHP):
Register your sites domain and get the keys you need on Googles reCAPTCHA website. https://developers.google.com/recaptcha
Note: This package is for version 3. Once submitted, Google will provide you with the following two information.
-
Site key
-
Secret key
Add keys to your config or functions.php file. Replace: YOUR-RECAPTCHA-SITE-KEY and YOUR-RECAPTCHA-SECRET-KEY
Basic Wordpress example if you use functions.php
Add the following code snippets to your functions.php file.
Google reCaptcha v3 JavaScript.
This php code will include all necessary JavaScript.
PHP Function to validate :
This function will run the captcha validation before posting. In this example it runs before comments are posted.
Thats it...
Class based examples for Wordpress
If you prefer PHP classes, this is a simple example.
Front end
Back End
More about how Google reCaptcha work.
https://en.wikipedia.org/wiki/ReCAPTCHA
https://developers.google.com/recaptcha/docs/v3
That's all folks :-)