我是 cURL 的新手,我正在尝试使用 php cURL 访问我的 ebay 帐户,我有一个现有的代码,但 ebay 似乎不允许我使用 cURL 登录。当我回显结果时,它只显示登录页面。
$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;
是否可以通过用户名和密码或令牌使用 php cURL 登录 ebay?