I have to get value of access_token from a URL, like:
localhost/facebook/#access_token=xyz
$_GET['access_token'] doesn't work. How can I get the value of access_token?
I have to get value of access_token from a URL, like:
localhost/facebook/#access_token=xyz
$_GET['access_token'] doesn't work. How can I get the value of access_token?
Use getAccessToken
$facebook->getAccessToken();
https://developers.facebook.com/docs/reference/php/facebook-getAccessToken/
$user = $facebook->getUser();
echo $facebook->getAccessToken();
if(!$user){
    $loginUrl = $facebook->getLoginUrl();
    echo '<a href="$loginUrl">Login with Facebook</a>';
}
Clicking login with take you to fb, you login/accept whatever, then it redirects you back to your page and you get your access token.
 
    
    I believe the hash part of the URL isn't sent to PHP, so can't be accessed via PHP. Javascript can access it, and can then pass it onto PHP.
There is a guide here showing how.
