Skip to content

Simple PHP class for reCAPTCHA verification. Can be used to easily work into any framework, or by itself.

License

Notifications You must be signed in to change notification settings

AndrewChamp/reCAPTCHA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

reCAPTCHA

Simple PHP class for reCAPTCHA verification. Can be used to easily work into any framework, or by itself.

Get your SITE & SERVER KEY here: https://www.google.com/recaptcha/

Setup / How To Use

Server-side

require('class.recaptcha.php');
$recaptcha = new recaptcha('your_SITE_KEY', 'your_SECRET_KEY');		
if(!$recaptcha->response()):
	print 'Sorry, you failed the reCAPTCHA';
else:
	// All your form processing here.
endif;

Client-side

If possible, paste this snippet before the closing </head> tag.

$recaptcha->script();

Put this at the end of the form where you want the reCAPTCHA widget to appear.

$recaptcha->widget();

You can optionally add different parameters to the 'widget' method. Shown below.

$recaptcha->widget('dark', 'compact');
// 1st param - 'light' is default (light|dark)
// 2nd param - 'normal' is default (normal|compact)

About

Simple PHP class for reCAPTCHA verification. Can be used to easily work into any framework, or by itself.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages