function getir($url)
{
$ch = curl_init();
$timeout = 10;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_HEADER,false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$my_url = $config['baseurl']."/";
$token_url = "https://graph.facebook.com/oauth/access_token?"
. "client_id=" . $A . "&redirect_uri=" . urlencode($my_url)
. "&client_secret=" . $B . "&code=" . $code;
$response = getir($token_url);
$params = null;
parse_str($response, $params);
$graph_url = "https://graph.facebook.com/me?access_token="
. $params['access_token'];
$user = json_decode(file_get_contents($graph_url));
$fname = htmlentities(strip_tags($user->name), ENT_COMPAT, "UTF-8");
$femail = htmlentities(strip_tags($user->email), ENT_COMPAT, "UTF-8");
//pics
$fbpid = htmlentities(strip_tags($user->id), ENT_COMPAT, "UTF-8");
$fbpicurl = "http://graph.facebook.com/".$fbpid."/picture";
$fbpicurl2 = "http://graph.facebook.com/".$fbpid."/picture?type=large";