cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: From cURL to Lib cURL

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 24 Aug 2005 00:21:59 +0200 (CEST)

On Tue, 23 Aug 2005, B Z wrote:

> Awsome! I got it to log in with the above options set. Once I am logged into
> xyz website, to navigate through other pages do I need to use a new
> curl_init(); or can I simply reset the options after the curl_exec()
> command??

This topic is really much more suitable for the curl-and-php mailing list.

But no, in recent versions of PHP you can re-use the handle and just set new
options and do another curl_exec() until you're done.

> I tried making a new curl_init() but it doesnt want to keep me logged in as
> I navigate the other pages of the site.

You'd then get a fresh handle, so you'd most probably have to somehow get the
cookies from the previous handle into this. Possibly by using
CURLOPT_COOKIEFILE.

> How does PHP/cURLs order of execution work?

Each curl_exec() performs a transfer and they are of course performed in the
order you call the curl_exec() function. Your PHP program controls that.

> Thanks again too all the helpfull people, but especially to Daniel Stenberg
> who's name I see a lot =).

I just can't stay away! ;-P

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-08-24