curl-library
Re: posting and cookies problem on windows
Date: Tue, 21 Aug 2001 13:23:28 +0200 (MET DST)
On Tue, 21 Aug 2001, Christie, Darren wrote:
> whats wrong with the following snippet of code?
It would help us if you told us what it does currently and in what way that
is wrong.
> I want it to post to a form (login), save the header (so I capture the
> cookie), and them post to another url which requires the cookie from the
> first form.
So, could you show us how the <form> looks like in HTML? (edit out sensitive
things)
> I am doing this under windows, if that helps.
It shouldn't make any difference.
> curl_formparse("username=AName",
> &formpost,
> &lastptr);
Are both these pointers (formpost and lastptr) set to NULL before this?
Are you actually supposed to do a rfc1867-style posting? It isn't very common
for login-forms to use that, which makes me believe you should instead
consider using...
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data_to_post);
... and remove all the curl_formparse() invokes.
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/Received on 2001-08-21