내 프로젝트 목적을 위해 내 페이스 북 계정에 원격으로 로그인하여 거기에서 정보를 검색해야합니다. 로그인 목적으로, 나는 PHP의 cURL 라이브러리를 사용하고 있습니다. 코드를 실행하면 페이스 북 페이지에서 이미 활성화 한 브라우저에서 쿠키를 활성화 할 것인지 묻습니다. 코드에 문제가 있습니까? 아무도 내 계정에 원격으로 로그인하는 것을 도와 줄 수 있습니까? 나는 초보자이며 정말로 도움이된다면 고맙겠습니다. 여기페이 스북 계정에 원격 로그인
<?php
//create array of data to be posted
$post_data['email'] = '*********';
$post_data['password'] = '**********';
$post_data['action'] = 'login';
//traverse array and prepare data for posting
foreach ($post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
//create the final string to be posted using implode()
$post_string = implode ('&', $post_items);
//create cURL connection
$ch = curl_init('https://login.facebook.com/login.php?');
//set options
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_USERAGENT,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
//set data to be posted
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
//perform our request
$result = curl_exec($ch);
print_r($result);
//close the connection
curl_close($ch);
?>
FB API를 사용하지 않는 이유는 무엇입니까? – Gordon
답변 주셔서 감사하지만 FB API를 사용할 수 없습니다. – insightful