Forum: Captchator ajax and captcha Permission Denied

Posted by Mark Babcock (markb)
on 2008-06-26 22:53
I keep getting a permission Denied and I'm not sure why.  Any able to
help with this?


<form name="myform">
<table>
    <tr>
           <td colspan="2"><img
src="http://captchator.com/captcha/image/123456"></td>
           <td><input type="button" value="reload captcha" alt="unable
to read captcha?"/></td>
    </tr>
    <tr>
           <td colspan="3"><input type="text" name="captchaValue"/></td>
    </tr>

</table>
</form>
<script language="JavaScript">
     var url = 'http://captchator.com/captcha/check_answer/123456/';
     var captchaOK = 2;  // 2 - not yet checked, 1 - correct, 0 - failed
     function getHTTPObject() {
          if(navigator.appName == "Microsoft Internet Explorer") {
              req = new ActiveXObject("Microsoft.XMLHTTP");
          } else {
              req = new XMLHttpRequest();
          }

         return req;

     }

      var http = getHTTPObject(); // We create the HTTP Object

      function handleHttpResponse() {
           if (http.readyState == 4) {
                 captchaOK = http.responseText;
                if(captchaOK != 1) {
                     alert('The entered code was not correct. Please try
again');
                     return false;
                }
              alert("Captcha okie dokie");
           }

      }

      function validateCaptcha() {

           var captchaValue = document.myform.captchaValue.value;
           var urlValidation = url + captchaValue;
alert(" ? " + urlValidation);
           http.open("GET", urlValidation);
alert("xx");
           http.onreadystatechange = handleHttpResponse;
alert("YY");
http.send(null);
      }
</script>
Posted by Jim .. (jtoly)
on 2008-06-27 05:19
Mark Babcock wrote:
> I keep getting a permission Denied and I'm not sure why.  Any able to
> help with this?

I just copied your code, created a new Rails project and set this code 
to be the index.html.erb file.

It "worked" fine for me, in so far as the captcha image loads, the 
button to reload the image is there and functions, and the text field 
accepts user input.

So while I don't see how your code was going to return a valid/not-valid 
response code (like I say I just pasted it in and haven't scrutinized 
it! :-), I don't get a Permission Denied problem.

Can you be more specific on when/where/how the error comes up?
Posted by Value Coupons (Guest)
on 2009-05-26 00:49

Such a wonderful info.......

http://www.bellesescorts.co.uk/Birmingham_Escort_Manchester/birmingham-escorts-services-escorts-birmingham/
Posted by Luis Pulido (pulidoman)
on 2009-09-30 16:38
Jim Tobin wrote:
> Mark Babcock wrote:
>> I keep getting a permission Denied and I'm not sure why.  Any able to
>> help with this?
> 
> I just copied your code, created a new Rails project and set this code 
> to be the index.html.erb file.
> 
> It "worked" fine for me, in so far as the captcha image loads, the 
> button to reload the image is there and functions, and the text field 
> accepts user input.
> 
> So while I don't see how your code was going to return a valid/not-valid 
> response code (like I say I just pasted it in and haven't scrutinized 
> it! :-), I don't get a Permission Denied problem.
> 
> Can you be more specific on when/where/how the error comes up?

I implemented the captchator service with jQuery and PHP, making it 
capable to handle AJAX. You can use the source code.

You can check it at http://luispulido.com/cc/captchator-jquery/

Hope you find it useful.

-Luis
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.