ใครเก่ง app Facebook เข้ามาหน่อย ช่วยแก้นิดหน่อย
อยากให้มันขึ้นแบบนี้งะครับ
(http://www.picza.net/img.php?p=vPllvZIxEP) (http://www.picza.net/show.php?id=vPllvZIxEP)
Thanks: ฝากรูป (http://www.picza.net)
app นี้ครับ
http://www.facebook.com/apps/application.php?id=312143095463865
มันขึ้น2ครั้ง - -
แล้วถ้าหน้านี้ไม่อยากให้แสดงก่อนทำไงครับ
http://www.facebook.com/idomovies?sk=app_312143095463865
หรือว่า ใส่Code นี้เข้าไปในหน้าเว็บเราด้วย
<?php
$app_id = "YOUR_APP_ID";
$app_secret = "YOUR_APP_SECRET";
$my_url = "YOUR_URL";
$perms = "user_actions.music, friends_actions.music";
session_start();
$code = $_REQUEST["code"];
if(empty($code)) {
$_SESSION['state'] = md5(uniqid(rand(), TRUE)); //CSRF protection
$dialog_url = "https://www.facebook.com/dialog/oauth?client_id="
. $app_id . "&redirect_uri=" . urlencode($my_url) . "&perms="
. $perms . "&state=" . $_SESSION['state'];
echo("<script> top.location.href='" . $dialog_url . "'</script>");
}
if($_REQUEST['state'] == $_SESSION['state']) {
$token_url = "https://graph.facebook.com/oauth/access_token?"
. "client_id=" . $app_id . "&redirect_uri=" . urlencode($my_url)
. "&client_secret=" . $app_secret . "&code=" . $code;
$response = file_get_contents($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));
echo("Hello " . $user->name);
}
else {
echo("The state does not match. You may be a victim of CSRF.");
}
?>
ช่วยหน่อยนะครับ
ขอบคุณครับ
https://www.facebook.com/dialog/permissions.request?app_id=312143095463865&display=page&next=http%3A%2F%2Fwww.idomovie.com%2Ffacebook%2Findex.php&response_type=code&state=766dd0fac4321780aa9b3028d74b5b45&fbconnect=1
งง
ดูเรื่องการ authen ครับ
https://developers.facebook.com/
อ้างถึงจาก: kokarat ใน 25 พฤศจิกายน 2011, 11:27:00
ดูเรื่องการ authen ครับ
https://developers.facebook.com/
งงอยู่ดี
https://developers.facebook.com/docs/reference/api/permissions/
:wanwan044: :wanwan044:
$perms = "publish_stream,email";
อ้างถึงจาก: @@@ ใน 25 พฤศจิกายน 2011, 13:42:21
$perms = "publish_stream,email";
change
$response = file_get_contents($token_url);
$params = null;
parse_str($response, $params);
to
$response = file_get_contents($token_url);
$params = "publish_stream,email"; //อื่นๆ อะไรก็ว่าไป
parse_str($response, $params);
อ้างอิง ตามนี้
https://developers.facebook.com/docs/authentication/
และ permissions ตามนี้
https://developers.facebook.com/docs/reference/api/permissions/