Hello, I am new to creating a facebook application and hence started out with a simple Hello World Application. But When I try to display my Name, it is not displayed.
This is my code:
<?php
require_once 'facebook.php';
$api_key = 'mykey';
$secret = 'mysecretkey';
$facebook = new Facebook($api_key, $secret);
$user = $facebook->require_login();
$fbml = "<h2>Hello world, my name is <fb:name uid='<?php echo $fb_user;?>' useyou='false' />,"
. "welcome to my first facebook application!</h2>";
echo $fbml;
?>
The output in my facebook app is,
Hello world,my name is,welcome to my first facebook application!
My name is missing here.
And If I add the code given below,to display the friend's list,
$friends = $facebook->api_client->friends_get();
echo "<pre>Friends:" . print_r($friends, true). "</pre>";
I get the error message,
Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed:
No such host is known.
in C:\Documents and Settings\256148\My Documents\ide\xampplite\htdocs\facebookApp\facebookapi_php5_restlib.php on line 1755
Warning: fopen(http://api.facebook.com/restserver.php) [function.fopen]:
failed to open stream: php_network_getaddresses: getaddrinfo failed:
No such host is known. in C:\Documents and Settings\256148\My Documents\ide\xampplite\htdocs\facebookApp\facebookapi_php5_restlib.php on line 1755
Please guide me.