I am trying to use eBay's new login feature that uses cookies to track a session. The problem now is that after submitting the login form, the resulting page forward me to a page that checks that the cookie set was returned to eBay and I am unsure how to accept and resend the cookies. Here is what I have so far...
=================================
<?
echo "Getting page...<br>";
$useragent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)';
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER,1);
curl_setopt($ch, CURLOPT_USERAGENT,$useragent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/mycookies");
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/mycookies");
curl_setopt($ch, CURLOPT_URL,"http://cgi3.ebay.com/aw-cgi/eBayISAPI.dll");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "MfcISAPICommand=SignInWelcome&siteid=0&co_partnerId=2&UsingSSL=0&ru=&pp=&pa1=&pa2=&pa3=&i1=-1&pageType=-1&userid=USERID&pass=PASSWORD&keepMeSignInOption=1");
ob_start(); // prevent any output
$page = curl_exec($ch); // execute the curl command
ob_end_clean(); // stop preventing output
echo "<PRE>".htmlentities($page);
curl_close ($ch);
unset($ch);
echo "Setting cookies...<br>";
#setcookies();
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/mycookies");
curl_setopt($ch, CURLOPT_URL,"http://www.ebay.com/");
$buf2 = curl_exec($ch);
curl_close($ch);
?>
Aaron Morris