Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eBay login using PHP cURL

Tags:

php

curl

I'm new to cURL and I'm trying to access my ebay account using php cURL, I have an existing code but ebay doesn't seem to let me log in using cURL. It just displays the login page when I echo the result.

$username="testtest"; 
$password="testtest"; 
$url="https://signin.ebay.co.uk/ws/eBayISAPI.dll?co_partnerId=2&siteid=3&UsingSSL=1"; 

$gacookie="/var/www/barcode/cookie/cookie.txt";
$postdata = 'userid='. $username .':pass='. $password;

$ch = curl_init(); 
curl_setopt ($ch, CURLOPT_URL, $url); 
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
curl_setopt ($ch, CURLOPT_TIMEOUT, 60); 
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); 
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt ($ch, CURLOPT_COOKIEJAR, $gacookie); 
curl_setopt ($ch, CURLOPT_COOKIEFILE, $gacookie);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata); 
curl_setopt ($ch, CURLOPT_POST, 1); 
$AskApache_result = curl_exec ($ch); 
curl_close($ch); 

echo $AskApache_result;

Is it possible to login to ebay using php cURL by username and password or tokens?

like image 407
Lao Avatar asked Aug 06 '26 14:08

Lao


1 Answers

Post data should look like this:

foo=bar&field=value

In your case:

$postdata = 'userid='. $username .'&pass='. $password;

like image 155
Skpd Avatar answered Aug 10 '26 00:08

Skpd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!