cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Simultaneous curl posts on the same URL [without curl_multi]

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 27 Sep 2005 19:53:27 +0200 (CEST)

On Tue, 27 Sep 2005, Baragan Andrei wrote:

> The problem is that i want to run multiple curls at once, on the same URL
> but with different post parameters.

> I have a main script in which i exec() a script curl.php with the right
> parameters. In curl.php i set the url, the parameters for the post, i
> curl_exec and get the results.

So how do you execute both of them at once?

> The problem is that only the last executed script gives me the right results
> (it posts the data), the previous executed ones do fill the html forms
> correctly but they don't submit the data.

Uh? curl cannot actually "fill in forms", it gets or sends data. So in what
way can it fill in a form without submitting it?

> I think that curl reuses connections, and maybe that is the problem.

No, it is not the problem. curl only reuses the same connection if the same
handle is used as the previous connection was done with.

> I even tried variable variables like $$ but nothing.

What does that mean? (I am a PHP rookie.)

> $$ch = curl_init();
> curl_setopt($$ch, CURLOPT_FORBID_REUSE,1);
> curl_setopt($$ch, CURLOPT_FRESH_CONNECT,1);

Since you only do one request and then kill the handle, these two options make
no difference.

The rest looked good to me.

> What setopt should i use so that curl would not reuse the connection

None, as there is no connection that it can re-use when used like this.

> or just how do i get the right results every time ?

I don't know, but you seem to be chasing for your bug in the wrong part of
your backyard.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2005-09-27