Search code examples
phpfacebooksdkxfbml

XFBML and Facebook PHP SDK


How do I get a person to connect to the website through the XFBML/JS then use the session/token with PHP SDK?

Right now we have

$this->facebook->getLoginUrl(array('scope' => 'email, user_location, publish_stream'))

Solution

  • Look at this site:

    http://blog.mixu.net/2011/01/03/implementing-facebook-login-part-2/

    You have to show a login button, which will redirect or refresh the page (with onLogin="window.location = url.com"). After the user has logged in to your site via the login button and the page has been refreshed, you can fetch all necessary data with php.