curl-and-php
Re: Ebay.com login problem
Date: Thu, 07 Aug 2003 05:56:00 +0000
Dear Daniel Stenberg,
Thanks you very much for your response. I have deeply studies the headers
sent and received from the Ebay server and notice that Ebay first set the
cookie before login. So i edited my code and its now working perfeclty. Any
one can use this code to sign in on http://www.ebay.com site
<?php
$LOGINURL =
"http://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn&UsingSSL=0&pUserId=saira2majid";
$agent = "up.b";
$header[] = "Accept: text/vnd.wap.wml,*.*";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie\cook_ebay");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie\cook_ebay");
$result = curl_exec ($ch);
curl_close ($ch);
$LOGINURL = "http://signin.ebay.com/aw-cgi/eBayISAPI.dll";
$post_fields =
"MfcISAPICommand=SignInWelcome&siteid=0&co_partnerId=2&UsingSSL=0&ru=&pp=&pa1=&pa2=&pa3=&i1=-1&pageType=-1&userid=saira2majid&pass=saira123";
$agent = "up.b";
$header[] = "Accept: text/vnd.wap.wml,*.*";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie\cook_ebay");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie\cook_ebay");
$result2 = curl_exec ($ch);
curl_close ($ch);
echo ($result2 );
?>
Best regards,
Imran Khalid
imranlink_at_hotmail.com
http://imrankhalid.5u.com
Res :- +92.437.602955
>If you think this is a (lib)curl problem, then please show us what headers
>the
>server sent you and what headers you sent back. In other words, what
>cookies
>that were being exchanged.
>
>Sorry, but I charge for writing/fixing other people's curl scripts.
>
>--
> Daniel Stenberg -- curl: been grokking URLs since 1998
>
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-07