reCaptcha without plugins, only JS

1,178 views
Skip to first unread message

cribcaged

unread,
Jul 19, 2010, 11:34:33 AM7/19/10
to reCAPTCHA
Hi to everyone,

i'm trying to use reCaptcha with Ajax
in my form, validation are all made by javascript, so php receive data
only when all form's field are correct!
so im' trying to do the same with reCaptcha

i put in my page with js:
Recaptcha.create("6******SAAAAADTBqYC5jcaWx2xUqdtEKmopmt7f",
'captchadiv', {
theme: 'blackglass',
callback: Recaptcha.focus_response_field
});

and it works
now i'm trying to verify captcha through js:

function whenUserClickOnTheSubmitForum(){
var xmlHttp = newXMLHttpRequest();
xmlHttp.open("POST",'http://www.google.com/recaptcha/api/
verify',true);
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-
urlencoded');
parametriScript =
"'6L******SAAAAAA4rqMlHjMwygq3FhFPhFPuBjSzk','localhost','"+Recaptcha.get_response()
+"','"+Recaptcha.get_challenge+"'";
xmlHttp.send(parametriScript);
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
if(xmlHttp.status == 200){
alert(xmlHttp.responseText);
}
}
}
}

but it doesn't work, firebug say:
OPTIONS verify
http://www.google.com/recaptcha/api/verify
405 Method Not Allowed
google.com

i think that page of verify without plugins (http://code.google.com/
intl/it-IT/apis/recaptcha/docs/verify.html) it's not almost clear...an
example can be explain better how to make this verify!!!

i can't verify through php (it's not my decision!), so how can i do
that?

Thank you

Daniele

reCAPTCHA Support

unread,
Jul 20, 2010, 10:17:30 PM7/20/10
to reca...@googlegroups.com
Hi,

This isn't possible. See the FAQ page on the Wiki:

http://wiki.recaptcha.net/index.php/FAQ#Can_I_use_reCAPTCHA_in_static_HTML_files.3F

"Not if all you have are static HTML files - you require a server-side
scripting language to verify the reCAPTCHA after it has been submitted
by your users. This verification cannot be done in static HTML using
Javascript or any other client-side language.
If you want reCAPTCHA you require either knowledge of a server-side
language or a web application (examples of both may be found at
http://recaptcha.net/resources.html,) and a hosting provider that will
allow you to use it."

Colin

> --
> 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.
>
>

--
reCAPTCHA: stop spam, read books
http://recaptcha.net

Reply all
Reply to author
Forward
0 new messages