开发者

how to use facebooks old client library

开发者 https://www.devze.com 2022-12-29 21:25 出处:网络
I installed the old library from here and then extracted the facebook.php file and wrote an index.php file in the same folder with the index .php file just displaying hello \"us开发者_运维百科ername\"

I installed the old library from here and then extracted the facebook.php file and wrote an index.php file in the same folder with the index .php file just displaying hello "us开发者_运维百科ername"; but the problem is the index.php when run in browser does not show anything, it's blank.

I have xamp installed on my system.

My index.php code is:

<?php
// Copyright 2007 Facebook Corp.  All Rights Reserved. 
// 
// Application: birthdaypost
// File: 'index.php' 
//   This is a sample skeleton for your application. 
// 

require_once 'facebook.php';

$api_key = 'fda501108b3b955bcf0f87a4008bc786';
$secret = '833b35812a3e6b379a5158b2f3f0611f';
$facebook = new Facebook($api_key, $secret);
$user_id = $facebook->require_login();
// Greet the currently logged-in user!
echo "<p>Hello, <fb:name uid=\"$user_id\" useyou=\"false\" />!</p>";


?>


Set Facebook App Canvas settings to "FBML" instead of "IFrame".

Make sure that the echo line looks something like:

echo "Hello <fb:name uid=\"$user_id\" useyou=\"false\" />!"

0

精彩评论

暂无评论...
验证码 换一张
取 消