cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Login on https page

From: <man_at_tfhs.net>
Date: Mon, 18 Jul 2005 01:03:11 -0000

you need to get a book on html or http programming.

your program did exactly what you asked it to, it downloaded a page with
two text boxes on it.

if what you wanted to do was to send the user name and password the same
way this page does, then try changing your url to point to the place the
<form> tag's 'action' points to: Logon.fcc

allan

On Sun, Jul 17, 2005, "vperrone_at_libero.it" <vperrone_at_libero.it> said:

> What do you means with "You need to fetch the first page in order to pick up any cookies it sends"? Didn't i fetch it in my code?
>
> And then...I have used even the "URL" and "target" hidden field, but nothing change...the same result.
>
> I'm not too much expert in html so if you can take a look to the page and tell me what fields i have to fill with CURLOPT_POSTFIELDS i'll give me a great pleasure...
> Thanks
>
>> You need to fetch the first page in order to pick up any cookies it
>> sends, then you need to post *all* the form variables back to the form
>> action url. That means all the hidden variables, as well as the
>> variables that display on the page.
>>
>> Ralph Mitchell
>>
>>
>> On 7/17/05, Vi.Per. <vperrone_at_libero.it> wrote:
>> > 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
>> >
>> >
>>
>>
>
>
>
> ____________________________________________________________
> 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero!
> Scaricalo su INTERNET GRATIS 6X http://www.libero.it
>
>
>
>

-- 
Received on 2005-07-18