How CURL Login with Captcha and Session How CURL Login with Captcha and Session curl curl

How CURL Login with Captcha and Session


A captcha is intended to differentiate between humans and robots (programs). Seems like you are trying to log in with a program. The captcha seems to do its job :).

I don't see a legal way around.


It happens because,
You took your captcha image from first getURL (ie first curl_exec) and processed the captcha but to submit your captcha you are requested getURL (ie again curl_exec) which means to a new page with a new captcha again.

So you are placing the old captcha and putting it in the new captcha. I'm having the same problem & resolved it.


Captcha is a dynamic image created by the server when you hit the page. It will keep changing, you must extract the captcha from the page and then parse it and then submit your page for a login. Captcha will keep changing as and when the page is triggered to load!