Hello I'm trying to make option for users to login to my site with their facebook accounts.
As far as I read in facebook api I have found only login with pop-up window, but I don't like It...
I'd like to make it like here on stackoverflow
1. user click on "login" image ot button
2. whole window goes to FB page and ask user for perm
3. get back user to my page...
If you use:
http://github.com/facebook/php-sdk
You can do something along the lines of:
$facebook = new facebook();
$fbSession = $facebook ->getSession();
//IF user is logged in
if ($fbSession)
{
$_SESSION['fbsession'] = json_encode($fbSession);
}
else
{
header('Location: '.$facebook->getLoginUrl());
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With