A short and easy example of CURL

<code>

$filename=”https://graph.facebook.com/oauth/access_token?client_id=&#8221;.FB_APP_ID.”&redirect_uri=http://”.$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI].”&client_secret=”.FB_APP_SECRET.”&code=”.$code;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $filename);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//$output = file_get_contents(urlencode($filename),true);
$output = curl_exec($ch);
var_dump(curl_error($ch));
exit();

</code>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s