klenwell information services : DevRecaptcha

Revision history for DevRecaptcha


Revision [2987]

Last edited on 2016-07-09 16:54:43 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
ReCaptcha is a multi-platform CAPTCHA plugin that can be used to stymie or discourage spammers, bots, and other online pests. I have used it in several of my projects, including [[UserSettings | this one]], as a spam-deterrent for comment and registration forms.
[[http://code.google.com/p/cakewell/source/browse/app/controllers/demo_controller.php?spec=svnbc8ea12b48aab05dd9e29765ce2597d8bb934851&r=bc8ea12b48aab05dd9e29765ce2597d8bb934851#189 | CakePhp]]
[[http://code.google.com/p/appswell/source/browse/appspot/appswell/controllers/demo_controller.py?spec=svn7bb540a2c236b642d5794397ef4025ac4378fab1&r=7bb540a2c236b642d5794397ef4025ac4378fab1#236 | Google App Engine]] (python)
Deletions:
ReCaptcha is a multi-platform CAPTCHA plugin that can be used to stymie or discourage spammers, bots, and other online pests. I have used it in several of my projects, including [[UserSettings this one]], as a spam-deterrent for comment and registration forms.
[[http://code.google.com/p/cakewell/source/browse/app/controllers/demo_controller.php?spec=svnbc8ea12b48aab05dd9e29765ce2597d8bb934851&r=bc8ea12b48aab05dd9e29765ce2597d8bb934851#189 CakePhp]]
[[http://code.google.com/p/appswell/source/browse/appspot/appswell/controllers/demo_controller.py?spec=svn7bb540a2c236b642d5794397ef4025ac4378fab1&r=7bb540a2c236b642d5794397ef4025ac4378fab1#236 Google App Engine]] (python)


Revision [1308]

Edited on 2010-04-17 15:52:02 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
%%(php)
<form action="{$recaptcha_form_url}" method="post">
{$recaptcha_html}
<input type="submit" name="{$recaptcha_post_key}" value="submit" />
</form>
Deletions:
<form action="{$recaptcha_form_url}" method="post">
{$recaptcha_html}
<input type="submit" name="{$recaptcha_post_key}" value="submit" />
</form>


Revision [1307]

Edited on 2010-04-17 15:50:39 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
Keys are obtained from the ReCaptcha website.
%%
require_once('recaptchalib.php');
$recaptcha_form_url = '/recaptcha.php';
$recaptcha_post_key = 'recaptcha_submit'; # ie, input button name
$recaptcha_private_key = 'YOUR_PRIVATE_KEY';
$recaptcha_public_key = 'YOUR_PUBLIC_KEY';
$RecaptchaResponse = NULL;
$RecaptchaError = NULL;
$recaptcha_reply = '';
$recaptcha_is_submitted = isset($_POST[$recaptcha_post_key]) ? 1 : 0;
if ( $recaptcha_is_submitted )
{
$RecaptchaResponse = recaptcha_check_answer (
$recaptcha_private_key,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"] );

if ( $RecaptchaResponse->is_valid )
{
$recaptcha_reply = '<div class="ok">recaptcha successful</div>';
}
else
{
$RecaptchaError = $RecaptchaResponse->error;
$recaptcha_reply = sprintf('<div class="fail">recaptcha error: %s</div>',
$RecaptchaError );
}
}
$recaptcha_html = recaptcha_get_html( RECAPTCHA_PUBLIC_KEY, $RecaptchaError );

$form_html = <<<XHTML
<div class="recaptcha_form">
<form action="{$recaptcha_form_url}" method="post">
{$recaptcha_html}
<input type="submit" name="{$recaptcha_post_key}" value="submit" />
</form>
</div>
XHTML;
print $form_html;
%%


Revision [1306]

Edited on 2010-04-17 15:34:15 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
ReCaptcha is a multi-platform CAPTCHA plugin that can be used to stymie or discourage spammers, bots, and other online pests. I have used it in several of my projects, including [[UserSettings this one]], as a spam-deterrent for comment and registration forms.
====PHP Usage====
====Other Examples====
[[http://code.google.com/p/cakewell/source/browse/app/controllers/demo_controller.php?spec=svnbc8ea12b48aab05dd9e29765ce2597d8bb934851&r=bc8ea12b48aab05dd9e29765ce2597d8bb934851#189 CakePhp]]
[[http://code.google.com/p/appswell/source/browse/appspot/appswell/controllers/demo_controller.py?spec=svn7bb540a2c236b642d5794397ef4025ac4378fab1&r=7bb540a2c236b642d5794397ef4025ac4378fab1#236 Google App Engine]] (python)
http://recaptcha.net/learnmore.html
http://en.wikipedia.org/wiki/CAPTCHA
Deletions:
For an example showing how to integrate ReCaptcha with CakePhp, see this [[http://code.google.com/p/cakewell/source/browse/app/controllers/demo_controller.php#180 Cakewell code]].


Revision [1305]

The oldest known version of this page was created on 2010-04-17 15:15:47 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]