I am getting this error in my PHP code:
ErrorCurlException: 7: Failed to connect to 255.255.255.255: Network is unreachable
Here is my code:
require_once 'src/facebook.php'; //include the facebook php sdk
$facebook = new Facebook(array(
'appId' => '*************', //app id
'secret' => '**********************', // app secret
));
$user = $facebook->getUser();
if ($user) { // check if current user is authenticated
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me'); //get current user's profile information using open graph
$email = $user_profile['email'];
echo"<script>alert(\"$name\");</script>";
} catch(Exception $e) {
$name="Error".$e;
}
}
echo"<script>alert(\"$name\");</script>";
?>
The same code is working on a different page. I am just a beginner and don't know much about FB API.