TechniqueSet the cookies property of the Net_Curl PEAR class: <?php // Initialize $conn = new Net_Curl('http://www.zend.com/'); if (Net_Curl::isError($conn)) { die(sprintf('Error [%d]: %s', $conn->getCode(), $conn->getMessage())); } // Set transfer options $conn->cookies = array(name => 'Sterling', email => 'sterling@php.net'); // Execute transfer $data = $conn->execute(); if (Net_Curl::isError($data)) { die(sprintf('Error [%d]: %s', $data->getCode(), $data->getMessage())); } print "The results of your transfer were: \n<br>\n"; print $data; ?> CommentsWhen setting the cookies property of the Net_Curl class, you can provide an array of key/value pairs; a file containing the cookie data in Netscape format or regular HTTP; colon -delimited data; or the raw cookie data itself (in Netscape or HTTP format). |