cURL / Mailing Lists / curl-users / Single Mail

curl-users

From cURL to Lib cURL

From: B Z <bz029_at_hotmail.com>
Date: Tue, 23 Aug 2005 09:01:51 -0700

So when I finally got comfortable with using curl commands, now I have a
need to use it within PHP - using LibcURL.

Can you help me convert:

curl -c /User/Aurobindo/nettemps/cookie.txt -L
http://desk.net-temps.com/login.html -d account=user -d password=pass -d
dest="http://desk.net-temps.com"

into the LibcURL using PHP? The command above works great! The one below
isn't working that I can tell... I think once I get comfortable with the
FLOW of libcurl it will be all good. anyways here's what i've been
atttempting, and I am getting a printout of "1". I'd like to see the
actually results from the server to know if my login attempts are
successfull. thanks!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$ch = curl_init();

curl_setopt($ch, CURLOPT_COOKIEFILE, "\User\Aurobindo\nettemps\cookie.txt");

curl_setopt($ch, CURLOPT_POSTFIELDS,
"account=user&password=pass&dest=http://desk.net-temps.com");

curl_setopt($ch, CURLOPT_URL, "http://desk.net-temps.com/login.html");

$test = curl_exec($ch);

curl_close($ch);

echo $test . "<br>";

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Received on 2005-08-23