自动Facebook登录与curl [英] Auto Facebook Login with Curl
问题描述
我试图使用curl自动登录到Facebook,但没有什么可以工作。最近我得到的是,我在我当前的窗口中登录(所以我有在my-server.com/facebooklogin.php上的普通facebook主页),但是当我在一个新的选项卡打开facebook.com我不记录
I'm trying to autologin to facebook using curl, but nothing will work. The nearest I got was that I logged in in my current window (so I had the normal facebook-homepage on my-server.com/facebooklogin.php), but when I open facebook.com in a new tab I'm not logged in anymore.
有人知道我可以用cURL / PHP或其他方式登录Facebook吗?
Does someone know how I can login into facebook with cURL/PHP or maybe something else?
代码:[选择]
function Send_to_Server($url) {
$ch = curl_init($url);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, 'email='.urlencode('MyEmail@Email.com').'&pass='.urlencode('MyPassword').'&login=Login');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER,0);
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_NOBODY, 1);
$result = curl_exec ($ch);
curl_close ($ch);
return $result;
}
$string = Send_to_Server('https://login.facebook.com/login.php?m&next=http%3A%2F%2Fm.facebook.com%2Fhome.php');
echo $string;
这不工作:DI没有任何输出, facebook
That doesn't work :D I don't have any output and I'm not logged in in facebook
问候
推荐答案
这似乎有你想要的。 ..
www.360percents.com/posts/php-curl-status-update-working-example
this seems to have what you want... www.360percents.com/posts/php-curl-status-update-working-example
这篇关于自动Facebook登录与curl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!