PHP Curl Demo Login Get cookie Help
Beginners Learn to use PHP curl simulation landing, such as the Weiphon forum with the following code success, landing www.xiaomi.com will not succeed, help AH. I think it's a question of getting a cookie. Trouble the cows to help solve. The sleepless night can not sleep Ah!
$cookie _file=tempnam ('./temp ', ' Cookie ');
$login _url= ' Https://account.xiaomi.com/pass/serviceLoginAuth ';
$post = ' user&pwd=&sid=eshop&callback=http%3a%2f%2forder.xiaomi.com%2flogin%2fcallback%3ffollowup% 3dhttp%253a%252f%252fwww.xiaomi.com%252f%26sign%3dmjk4nmvlyzniowy5ytkwmjexnzg5mjkynze3zmixogm4ytbimdk1mg%2c%2c &_sign=f%2fkb8safmalz0s28kcltbsmzlem%3d&_json=true '//Avoid unnecessary trouble post specific account password removed
$ch = $curl =curl_init ($login _url);
curl_setopt ($ch, curlopt_header,0);
curl_setopt ($ch, curlopt_returntransfer,0);
curl_setopt ($ch, curlopt_post,1);
curl_setopt ($ch, Curlopt_cookiejar, $cookie _file);
curl_setopt ($ch, Curlopt_postfields, $post);
Curl_exec ($ch);
Curl_close ($ch);
$url = "http://www.xiaomi.com/index.php";
$ch =curl_init ($url);
curl_setopt ($ch, curlopt_header,0);
curl_setopt ($ch, curlopt_returntransfer,0);
curl_setopt ($ch, Curlopt_cookiefile, $cookie _file);
$contents =curl_exec ($ch);
Curl_close ($ch);
?>
Share to:
------Solution--------------------
Account name Error
Please enter your account name
Please enter your password