views:

18

answers:

2

On some websites, when you want to login, you need to enter a captcha as well. If I want to provide support for an user to enter a captcha into my application ( which will then log into the website ), how would I do this?

My problem is that the link to the captcha image is like this: example.com/captcha , and it serves a different image each time it's accesed.

My approach is like this:

  • request page
  • download image
  • show image to user
  • user inputs login information
  • application logs in

The thing is, if you download the image in order to show it to the user, you're actually receiving a different image than the one generated when the page was loaded, right? How can I get to the image that was generated when the page was loaded, so that when I show it to the user, it's the correct one?

The question is language agnostic.

A: 

It sounds like you're trying to invent a captcha solution yourself. Have you considered using reCAPTCHA? It's free.

Marc Novakowski
No. Sorry if I did not express myself correctly. The website I'm trying to log into is not ours. Only the client app is. The captcha image is on server side. I'm only trying to display it on the client GUI app.
Geo
A: 

The image that's generated is also the image served to the user. Your 'main' html page doesn't/shouldn't generate the image, it only embeds it using the image tag.

Evert