how to use facebooks old client library
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\" />!"
精彩评论