Jump to content

Amazon Login with curl problems


yoandrey

Recommended Posts

Well I'm pretty new to php and curl so  as always best way to learn it is by coding it ,so I started to code a script to remote login into amazon ,but I can even manage to load up the site . Any help ?

Here is my code .

<?php
$url='https://source.amazon.com/forcelogin?returnToURL=https://www.amazon.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

curl_setopt($ch, CURLOPT_USERAGENT,
    "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7");
curl_setopt($ch, CURLOPT_COOKIEFILE,'cookies.txt');	
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt"); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0 );
$data = curl_exec($ch); 
var_dump(curl_getinfo($ch));

echo curl_error($ch);
curl_close($ch); 

?>

I can understand why is not working.

Link to comment
https://forums.phpfreaks.com/topic/294530-amazon-login-with-curl-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.