-1

I am doing a captcha in my website and each time the user registers and the captcha is wrong, I want to flash and say that the captcha is wrong.

This is the variable that I want to send:

var code = a + b + c + d + e;

In the register I want to check if the code is correct (the user entered the right captcha). If it is fine and all of the other parts are fine (they all work properly instead of the captcha) it redirects to a different page. If not it will flash that the captcha is wrong and redirects back to the same page.

T. Simkin
  • 41
  • 1
  • 7
  • What is your problem? Security wise please don't try to implement your own captcha, use a existing solution. – moritzg May 16 '17 at 11:26
  • @moritzg My problem is, how do i send a variable from javascript to flask python and implement it there. I'm not using my own captcha, I found one online: http://allwebco-templates.com/support/script-simple-captcha.htm – T. Simkin May 16 '17 at 11:29
  • 1
    I'm sorry but the captcha you linked isn't really a captcha. There's no point in using it, because the value the user should input can easily be scraped with `JQuery` etc. – moritzg May 16 '17 at 11:34

1 Answers1

1

Please use a real CAPTCHA solution like reCAPTCHA. Coding your own is not a good idea.

And generally if you want to send data from your Javascript to your Webserver you should use a GET or POST request.

Refer to this question if you really want to design your own (don't do it)

Community
  • 1
  • 1
moritzg
  • 4,266
  • 3
  • 37
  • 62