Monday, October 31, 2011

Facebook app development Facebook Api PhP - Fbname.php

The User Of Your App Friend's Names ... when a user logs into your app he could show all of his friends and know how many are they and thier (first name | last name) ....

Fbname.php Code

<?php
require 'config.php';
$friends = $facebook->api('/me/friends');
$simple_array=$friends['data'];
echo '<font color=white>';
foreach($simple_array as $key=> $value){
$freinds_name[]=$value['name'];
}
echo '<b><ol>';
for($i=0;$i<count($freinds_name);$i++){
echo "<li>" . $freinds_name[$i]. "</li>";
}
echo '</ol></b>';
echo "<br />" . "You Have " . $i . " Friends";
echo "<br />";
echo '</font>';
?>
<?php
$redirectUrlk = "https://www.facebook.com/dialog/oauth?client_id=118487369116&redirect_
uri=http://evry1falls.freevar.com/test12/index.php&state=
5da7ce9f0201f209c7d699cb881c3b02&scope=read_stream,friends_likes"; ?>
<center> <a href = "<? $redirectUrlk ; ?> . ">Back</a></center>
view raw gistfile1.phtml hosted with ❤ by GitHub

Config.php Previous || Next Feed.php