Facebook apps.I gelişen yeni Im sorunu şu var ve birisi yardımcı olabilir mutluluk duyarız.
Ben facebook benim app tescil ve barındırma sunucusuna kodu ve php istemci kütüphanesi yükledik. I aşağıdaki kodu kullanırsanız o zaman her şey çalışıyor.
<?php
require_once('./facebook/php/facebook.php');
/* initialize the facebook API with your application API Key
and Secret */
$facebook = new Facebook("<my_api_key>","<my_secret_key>");
$user = $facebook->require_login();
echo "<p>Your User ID is: $user</p>";
echo "<p>Your name is: <fb:name uid=\"$user\" useyou=\"false\"/></p>";
echo "<p>You have several friends: </p>";
$friends = $facebook->api_client->friends_get();
echo "<ul>";
foreach ($friends as $friend) {
echo "<li><fb:name uid=\"$friend\" useyou=\"false\" /></li>";
}
echo "</ul>";
/* Echo some information that will
help us see what's going on with the Facebook API: */
echo "<pre>Debug:" . print_r($facebook,true) . "</pre>";
?>
I aşağıdaki gibi iki dosya içine kodu bölerseniz i http://apps.facebook.com/myapp gittiğinizde Ama, sonra ben sadece boş bir tuval olsun
appinclude.php
<?php
require_once('./facebook/php/facebook.php');
/* initialize the facebook API with application API Key
and Secret */
$facebook = new Facebook("<my_api_key>","<my_secret_key>");
$user = $facebook->require_login();
?>
index.php
<?php
require_once('./appinclude.php');
echo "<p>Your User ID is: $user</p>";
echo "<p>Your name is: <fb:name uid=\"$user\" useyou=\"false\"/></p>";
echo "<p>You have several friends: </p>";
$friends = $facebook->api_client->friends_get();
echo "<ul>";
foreach ($friends as $friend) {
echo "<li><fb:name uid=\"$friend\" useyou=\"false\" /></li>";
}
echo "</ul>";
/* Echo some information that will
help us see what's going on with the Facebook API: */
echo "<pre>Debug:" . print_r($facebook,true) . "</pre>";
?>
Bunu düzeltmek için herhangi bir şekilde?
Teşekkür ederiz.