zoneroot/recaptcha

Simple recaptcha class

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/zoneroot/recaptcha

dev-master 2015-01-17 00:24 UTC

This package is not auto-updated.

Last update: 2025-10-11 21:43:33 UTC


README

Simple recaptcha static php class.

Installation

With composer :

"zoneroot/recaptcha": "dev-master"

Usage

First you need to init the recaptcha with your keys :

use \zoneroot\recaptcha\recaptcha;
recaptcha::init("public key", "private key");

Then in your head tag insert :

echo recaptcha::script()

Next in your form tag insert :

echo recaptcha::html()

Finally you must check if the captcha is valid :

try {
	recaptcha::check()
	echo "Captcha is valid";
} 
catch (\zoneroot\recaptcha\exceptions\invalidRecaptchaException $e) {
	echo $e->getMessage();
}
catch (\zoneroot\recaptcha\exceptions\connectionException $e) {
	echo $e->getMessage();
}

Contributing

For contributing just follow the code style.

Todo

Add some comment

####Inspired by grafikart