hi!!
i wanna login to facebook using php curl method

..i found a topic in this forum but found
no codei'm posting the code i've used ..i'm a beginner, so the code might be funny

i've replaced palceholders (my_email and my_password) instead of my actual username and password..
<?php
function initial_visit() //just to store the cookies initially set
{
$ckfile = "G:\wamp\www\cookie.txt";
$ckjar = "G:\wamp\www\cookiejar.txt";
$ch = curl_init ("http://www.facebook.com/");
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckjar);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
}
function second_visit() //use the cookies acquired earlier to use here
{
$ckfile = "G:\wamp\www\cookie.txt";
$ckjar = "G:\wamp\www\cookiejar.txt";
$ch = curl_init ("http://www.facebook.com/login.php");
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
$postfields = "POSTDATA=charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&version=1.0&return_session=0&session_key_only=0&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&lsd=_XhNM&email=my_email&pass=my_password";
curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckjar);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$postfields);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$output = curl_exec ($ch);
echo $output;
}
initial_visit();
sleep(10); // simply to mock a human donno if it's required ;D
second_visit();
?>
Any help would be appreciated...