Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> curl i ebay, logowanie
-Gość_obcy-
post
Post #1





Goście







Hej,

chciałem zalogowac się do ebaya uzywajac curla, ale cos nie działa

  1. <?php
  2.  
  3. // 1-Get First Login Page http://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn
  4. // This page will set some cookies and we will use them for Posting in Form data.
  5.  
  6. $ebay_user_id = ''; // Please set your Ebay ID
  7. $ebay_user_password = ''; // Please set your Ebay Password
  8. $cookie_file_path = 'ebay.txt'; // Please set your Cookie File path
  9.  
  10. $LOGINURL = "http://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn";
  11. $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
  12.     $ch = curl_init(); 
  13.     curl_setopt($ch, CURLOPT_URL,$LOGINURL);
  14. curl_setopt($ch, CURLOPT_USERAGENT, $agent);
  15.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
  16. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  17. curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
  18. curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
  19.     $result = curl_exec ($ch);
  20.     curl_close ($ch);
  21.  
  22. // 2- Post Login Data to Page http://signin.ebay.com/aw-cgi/eBayISAPI.dll
  23.  
  24. $LOGINURL = "http://signin.ebay.com/ws/eBayISAPI.dll";
  25. $POSTFIELDS = 'MfcISAPICommand=SignInWelcome&siteid=0&co_partnerId=2&UsingSSL=0&ru=http://my.ebay.com:80/ws/eBayISAPI.dll?MyeBay&pp=&pa1=&pa2=&pa3=&i1=-1&pageType=1883&rtmData=&userid='. $ebay_user_id .'&pass='. $ebay_user_password;
  26.     $reffer = "http://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn";
  27.  
  28. $ch = curl_init(); 
  29.     curl_setopt($ch, CURLOPT_URL,$LOGINURL);
  30. curl_setopt($ch, CURLOPT_USERAGENT, $agent);
  31.     curl_setopt($ch, CURLOPT_POST, 1); 
  32.     curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS); 
  33.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
  34. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  35. curl_setopt($ch, CURLOPT_REFERER, $reffer);
  36. curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
  37. curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
  38.     $result = curl_exec ($ch);
  39.     curl_close ($ch); 
  40. echo  $result;
  41.  
  42. ?>


Ciągle dostaje wiadomość "The browser you are using is rejecting cookies. "
A przecież wysyłam cookies.

Moze wiecie co moze byc nie tak ?

dzięki

----------
Dla php uzywaj bbcode [ php ].
-- dr_bonzo
Go to the top of the page
+Quote Post
sf
post
Post #2





Grupa: Zarejestrowani
Postów: 1 597
Pomógł: 30
Dołączył: 19.02.2003
Skąd: Tychy

Ostrzeżenie: (0%)
-----


tutaj chodzi chyba o odbieranie plików cookie, a nie wysylanie


--------------------
Zapraszam na mój php blog, tworzenie stron.
Go to the top of the page
+Quote Post
-Gość_obcy-
post
Post #3





Goście







wiesz moze jak powinien wygladac poprawny kod ?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 08:53