Testing re-CAPTHCA in a Test Server

1,321 views
Skip to first unread message

AlexL

unread,
Dec 15, 2010, 1:38:25 PM12/15/10
to reCAPTCHA
I want to test re-captcha on a test Linux server.

My test linux server is setup to host a website with a dummy domain
name, on my local network.

One of the requirements to signing up for re-captcha is that I must
enter a valid domain name.
I am not using a registered domain name on my test server.

The test server does have internet access to get to the captcha
verification service.

Is there anyway I can get around this for testing purposes?

Thanks.

Adrian Godong

unread,
Dec 15, 2010, 1:45:11 PM12/15/10
to reca...@googlegroups.com
reCAPTCHA is a hosted service, so you'll have to have an Internet
connection to reCAPTCHA servers.

I usually skip reCAPTCHA validation on test servers and enable it on
production. If you're concerned about production settings, you can
create a test page that does nothing but validate the reCAPTCHA on the
production server. That way, you can be sure that reCAPTCHA works
before deploying your real application.

Or, use the AJAX API.

> --
> You received this message because you are subscribed to the Google Groups "reCAPTCHA" group.
> To post to this group, send email to reca...@googlegroups.com.
> To unsubscribe from this group, send email to recaptcha+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/recaptcha?hl=en.
>
>

--
Adrian Godong
adrian...@gmail.com

AlexL

unread,
Dec 15, 2010, 1:59:08 PM12/15/10
to reCAPTCHA
Adrian,

Thanks for your response.

My test server does have an internet connection.

All references in the Developer Guide indicate that to display re-
capture on a web page I would need to enter a Public Key.
Below is sample code.

-----------------------------------
<html>
<body> <!-- the body tag is required or the CAPTCHA may not show
on some browsers -->
<!-- your HTML content -->

<form method="post" action="verify.php">
<?php
require_once('recaptchalib.php');
$publickey = "your_public_key"; // you got this from the
signup page
echo recaptcha_get_html($publickey);
?>
<input type="submit" />
</form>

<!-- more of your HTML content -->
</body>
</html>
-------------------------------------------------------

In order to get this key I need to signup.
In order to signup I need to enter a valid domain (which I do not
have).

Even the AJAX API mentions the same thing. See sample code below:

-------------------------------------------------------
<!-- Wrapping the Recaptcha create method in a javascript function -->
<script type="text/javascript">
function showRecaptcha(element) {
Recaptcha.create("your_public_key", element, {
theme: "red",
callback: Recaptcha.focus_response_field});
}
</script>
---------------------------------------------------------

I would like to at least display the re-captcha on a web page, and
skip the PHP validation process (for testing) as you earlier
mentioned.

Thanks.
> adrian.god...@gmail.com

Adrian Godong

unread,
Dec 15, 2010, 3:38:39 PM12/15/10
to reca...@googlegroups.com
Wow, I've misread a lot of e-mails today. Terribly sorry.

If you just need to display reCAPTCHA, then there shouldn't be any
problem using any public key. This is done client-side and reCAPTCHA
doesn't validate referrer then displaying a challenge.

I'm quite sure you can't validate if referrer domain and the keys
doesn't match, so just skip it on your test server.

AlexL

unread,
Dec 15, 2010, 3:53:22 PM12/15/10
to reCAPTCHA
Thanks Adrian.

I will try your suggestions.

Regards.
Reply all
Reply to author
Forward
0 new messages