2011
reCAPTCHA is a free CAPTCHA service that protects your site against spam, malicious registrations and other forms of attacks where computers try to disguise themselves as a human;
A CAPTCHA is a Completely Automated Public Turing test to tell Computers and Human Apart. reCAPTCHA comes in the form of a widget that you can easily add to your blog, forum, registration form, etc. Therefore, reCAPTCHA has been become the most powerful captcha to prevent against SPAM or automatic form filling script attacks.
To learn how reCAPTCHA works, read it here. There are a PHP plugin for reCAPTCHA which you can download it here and if you would like to read it's documentation, you may read it here.
If you had already running a web application (most likely a website or blog) based on Panada Framework. I had the PHP plugin conversion for Panada Framework library for you to use. You may download the reCAPTCHA library here:
-
Initial release
reCAPTCHA Panada Framework library v1.0 (9.79 kB) - download
Notes: This library conversion was built based on reCAPTCHA PHP plugin v1.11
Installation
Follow these steps to install and use the library on your Panada application:
-
Put the downloaded library file on your
apps/library/folder, so it has the following path:
/apps/library/recaptcha.phpwhere/is your Panada application root directory. - Create your own reCAPTCHA API key here to get your reCAPTCHA public key and private key.
-
So now you already have your public key and private key.
Put your public key and private key on your panada application configuration file:/apps/config.php
Add the following lines to your configuration file:
/* reCAPTCHA key configuration */$CONFIG['recaptcha_publickey'] = "your_public_key";$CONFIG['recaptcha_privatekey'] = "your_private_key";
replaceyour_public_keywith your already created reCAPTCHA public key and replaceyour_private_keywith your reCAPTCHA private key
Put the following PHP code on your desired view files:
<?php$recaptcha = new library_recaptcha();echo $recaptcha->recaptcha_get_html($this->config->recaptcha_publickey);?>
<form> and </form> tags where you need to put the reCAPTCHA on.// ... your previous php code ...$recaptcha = new library_recaptcha;$resp = $recaptcha->recaptcha_check_answer ($this->config->recaptcha_privatekey,$_SERVER["REMOTE_ADDR"],$_POST["recaptcha_challenge_field"],$_POST["recaptcha_response_field"]);if (!$resp->is_valid) {// What happens when the CAPTCHA was entered incorrectlydie( "The reCAPTCHA wasn't entered correctly. Go back and try it again." ."(reCAPTCHA said: " . $resp->error . ")" );}// ... your next php code ...
Posted under PHP, Panada Framework categories.
Tagged: PHP, Panada
Write Your Comments
* Your email is required to submit this form, and it will not be published or shared without your consent. We use your email address to show your avatar picture profile from Gravatar. Don't have one? Then sign up to gravatar and create your own here.
We also filters your comment against SPAM because we hate SPAM as much as you do. If your comment is recognized as SPAM then it will be moderated, otherwise it will shows up immediately.
369 Hits