-1

Not sure what the problem is here..

<?php require_once 'Facebook/autoload.php'; 

session_start()

$fb = new Facebook\Facebook([
  'app_id' => 'xxxx',
  'app_secret' => 'xxxx',
  'default_graph_version' => 'v2.5',
]);

$helper = $fb->getRedirectLoginHelper();
$permissions = ['email', 'name', 'user_id']; // optional
$loginUrl = $helper->getLoginUrl('http://www.website.co.uk/index.php', $permissions);

echo '<a href="' . $loginUrl . '">Log in with Facebook!</a>';

?>

I get an error :

Parse error: syntax error, unexpected '$fb' (T_VARIABLE) in /homepages/4/d570601812/htdocs/daf/inc/head.php on line 5"

Joya
  • 33
  • 1
  • 8

1 Answers1

0

You forgot about semicolon.

Change session_start() to session_start(); on the second line of your code.

Volodymyr Chumak
  • 756
  • 6
  • 12