note 41565 added to ref.curl
| From: | a_zazello at yahoo dot com | Date: | Wed, 14 Apr 2004 23:23:35 +0000 |
| Subject: | note 41565 added to ref.curl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-68138@lists.php.net to get a copy of this message | ||
If I want to use CURLOPT_COOKIEFILE and CURLOPT_POSTFIELDS in the same request.
The post fields are not inserted in the HTTP header as I expected!
$url = "http://www.url.com";
$data = "key1=val1&key2=val2";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIEFILE, "cook");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch); // run the whole process
curl_close($ch);
echo $result;
PHP 4.3.3 libcurl/7.10.5
----
Manual Page -- http://www.php.net/manual/en/ref.curl.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41565
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41565&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41565&report=yes
Search -- http://master.php.net/manage/user-notes.php