cURL / Mailing Lists / curl-library / Single Mail

curl-library

Login on https page

From: Vi.Per. <vperrone_at_libero.it>
Date: Sun, 17 Jul 2005 15:29:46 +0000

Hi!
I'm trying to login to that page:
https://bancopostaonline.poste.it/bpol/bancoposta/formslogin.asp using
libcurl in C.

That is what I've done:

CURL *curl;
CURLcode res;

                curl = curl_easy_init();
                curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
                curl_easy_setopt(curl, CURLOPT_URL,
"https://bancopostaonline.poste.it/bpol/bancoposta/formslogin.asp");
                curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0
(Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1
(ax)");
                curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookie.txt");
                curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookie.txt");
                curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2);
                curl_easy_setopt(curl, CURLOPT_POST, 1);
                curl_easy_setopt(curl, CURLOPT_POSTFIELDS,
"bpolMenuID=menu_login&USER=xxx&Password=xxx");
                curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
                res = curl_easy_perform(curl);
                curl_easy_cleanup(curl);
               

but all I can get is the login page again...

Now even if the username or password are wrong I should get the error
page, not the login page again!

Can anyone help me to get a successful login to that page?
In the html sorce there are some hidden fields and a Logon.fcc is that
the problem?
Thanks
Received on 2005-07-17