I used the following code to configure the facebook API and my structure what to follow is also OK. But I am receiving warning like that.
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /customers/2/1/f/mrprofessional.se/httpd.www/ziaullah/index.php:6) in /customers/2/1/f/mrprofessional.se/httpd.www/ziaullah/src/facebook.php on line 49 Login
you can see the error by clicking on that link
The Code is given
<html>
<head>
<title>PHP SDK</title>
</head>
<body>
<?php
require_once 'src/facebook.php';
$facebook = new Facebook(array(
'appId' => '198516340340394',
'secret' => 'f11117b96e0996ecbf7d7f4919c0cf70',
'cookie' => true
));
$user = $facebook->getUser();
$user_profile = null;
if ($user) {
try {
$user_profile = $facebook->api('/me');
$facebook->api('/me/feed/', 'post', array(
'message' => 'I want to display this message on my wall'
));
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
if ($user_profile) {
$logoutUrl = $facebook->getLogoutUrl();
echo '<a href="$logoutUrl">Logout</a>';
} else {
$loginUrl = $facebook->getLoginUrl(array(
'scope' => 'publish_stream, read_friendlists'
));
echo '<a href="$logoutUrl">Login</a>';
}
?>
</body>
</html>
Please help me if possible I will be thankful