NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: DonRidley on June 17, 2010, 06:35:43 AM
-
I don't have Draw. I was looking at jCap ( http://www.archreality.com/jcap/ ) but I have no idea of how to implement it.
Thanks,
Don
-
Hi Don,
We use reCaptcha, the google one. It works nice. It requires a HTTPS Post to their webservice, but its pretty simple.
If you look at http://prdrobina.litehouse.com.au/ArticlePage?id=16 you'll see an example. The Captcha on that page doesn't behave differently irrespectively of whether the captcha is successful or not (our code knows, but i haven't built the screen to tell them they got it wrong). Also please don't play with the [Send Immediately] button as it currently sends me an SMS message each time someone clicks on [Send].
But at least you'll get the idea.
Regards
Bill
-
I use a version of reCaptcha in a Joomla site. I need a shove in the right direction as far using it with NetTalk.... please....
Thanks,
Don
-
Hi Don,
That site is done in NT5.
You'll be familiar with the HTML required to add the Captcha, mine looks like this:
<script type="text/javascript">
var RecaptchaOptions = {theme : 'clean' };
</script>
<script src="http://api.recaptcha.net/challenge?k=***mykey***" type="text/javascript"></script>
<noscript><iframe src="http://api.recaptcha.net/noscript?k=***mykey***" height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea><input type="hidden" name="recaptcha_response_field" value="manual_challenge"></noscript>
Thats placed within a form. So in NT embed it as either XHTML or via embed point so it generates within your form.
When the form submits you'll get the following additional fields:
recaptcha_challenge_field
recaptcha_response_field
These fields require "testing" via their webserver to determine whether the user got it right or wrong.
This requires a HTTPS POST.
I wrote a quick little procedure called "PostFormResponse" to do a form POST submission.
After the form is submitted i then:
lResponse = PostFormResponse('http://api-verify.recaptcha.net/verify','privatekey=***key***&remoteip='&p_web.RequestData.FromIP&'&challenge='&CLIP(p_web.GetValue('recaptcha_challenge_field'))&'&=&response='&p_web.GetValue('recaptcha_response_field'))
lResponse holds the response from their webservice. "true" on the second line means they got it right false means they didn't.
As the webservice is HTTPS, then you need to make sure certain files are available for HTTPS to work (in NT Doco under HTTPS) I also needed to copy the CARoot.pem into the program folder.
Thats a rough outline.
Essentially:
1. Get the captcha code inside your form so the two fields it generates get submitted in the form.
2. After the form submits, but before you do anything else call their webservice and check whether it works.
The function PostFormResponse will be attached as TXA (TXT actually since it doesnt allow TXA).
Regards
Bill
[attachment deleted by admin]
-
YOU are the man!! Thank you!!!
-
Hey Bill,
I sent you a email reference the TXA.
Also, where do I get the CARoot.pem file?
Thanks,
Don
-
The caroot.pem file is in a sub directory of the big netdemo app - I suspect other places as well, but start there.
cheers
Bruce
-
Thanks Bruce!
-
Got it working!! Thanks Bill!!
-
Don,
May you please post an example app?
Thanks
Alberto
-
Yes I will. I waited for Bill's permission, because without his help, I would have never figured it out. I'll try to get an example posted by the end of the day.