I am writing an application that will print all of the user's friends.
<?php
$api_key = 'xxxxxxxxxx';
$secret = 'xxxxxxxxxxxxxxxxx';
include_once './facebook-php-sdk-master/src/facebook.php';
$facebook = new Facebook($api_key, $secret);
$user = $facebook->getUser();
?>
<h1>Facebook friends</h1>
Hello <fb:name uid='<?php echo $user; ?>' useyou='false' possessive='true' />! <br>
Your id : <?php echo $user; ?>.
Friends List:<br>
<?
$friends = $facebook->api('/me/friends');
?>
<ul>
<?
foreach($friends as $friend){
echo "<li><fb:name uid=\"$friend\" useyou=\"false\"></li>";
}
?>
</ul>
i am getting this as result:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/kurokmed/public_html/fb/index.php:2) in /home/kurokmed/public_html/fb/facebook-php-sdk-master/src/facebook.php on line 49 Facebook friends
Hello ! Your id : 0. Friends List:
Fatal error: Uncaught OAuthException: Error validating application. Cannot get application info due to a system error. thrown in /home/kurokmed/public_html/fb/facebook-php-sdk-master/src/base_facebook.php on line 1254
please tell me what am i doing wrong