9lessons programming blog
Loading Search
Monday, September 19, 2011

Update - Login with Facebook and Twitter

Long days back we had posted an article Login with Facebook and Twitter. It’s now most visited article on 9lessons. I received many comments that asked to me to update the Facebook login system to get user email. So that I had modified existing script to getting Facebook email address automatically and storing Twitter OAuth tokens, take a quick look at new live demo.

Facebook Twitter Login


Download Script     Live Demo

Sponsored Links

Share this post

Comments
{ 30 comments }
Anonymous said...

Will be cool if this tutorial include also yahoo, google+ , gmail login or some of them. If this is in plan for future please let us know. By the way thank you very much for this and for all what you done !

Bharath Mandava said...

Nice demo srinivas ! Thanks for sharing...

Anonymous said...

i have been waiting for ur wall script version 4 . its being a month u not releasing it . and u promised it 1 months back that next week you gonna release it . at least don,t make fake promises . i really follow your blog to learn stuffs . but m sorry t say its disappointing.

Alex G said...

@Anonymous - How about saying thank you instead of complaining.

Web development tips and tricks said...

i love this option. but i need this same option with asp or aspx. if you possible plz help me. i am a regular visitor.

Anonymous said...

Thanks for your sharing. I am very interesting this topic. I was wait twenty four hour but I can't download that script. Please help me!

Nicholas Horvath said...

It looks like a fantastic script, but I also am not able to download it.

Nosredna Habo said...

What Can I say, Thank you. You've doing just fine

nassim rehali said...

thank you very much mr tamada

Anonymous said...

When I try to login with facebook, the following error occurs:

Warning: Missing argument 5 for User::checkUser(), called in /var/www/web1353/html/auth/login-facebook.php on line 35 and defined in /var/www/web1353/html/auth/config/functions.php on line 7

Warning: Missing argument 6 for User::checkUser(), called in /var/www/web1353/html/auth/login-facebook.php on line 35 and defined in /var/www/web1353/html/auth/config/functions.php on line 7

Srinivas Tamada said...

Download script and table updated.

Dan said...

Hi! This is a great script. It has been very useful. I just have a question (maybe it's a silly one) What is the purpose of saving in the database the token and secret token?

Srinivas Tamada said...

@Dan

Using token you can access twitter data anytime.

Dan said...

Ok, ok. I should save the access token and access token secret right?
And another question. Is there a way, to get the oauth_verifier/denied from Twitter via POST?
(I have change the getRequestToken() and getAccessToken() method to POST, but the oauth_verifier is still coming via GET)

ជា​ Samnang said...

Hi Bro Srinivas,
I got error...

Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.' in C:\wamp\www\Facebook_Twitter_Login 3\Facebook_Twitter_Login\facebook\base_facebook.php:19 Stack trace: #0 C:\wamp\www\Facebook_Twitter_Login 3\Facebook_Twitter_Login\facebook\facebook.php(18): require_once() #1 C:\wamp\www\Facebook_Twitter_Login 3\Facebook_Twitter_Login\login-facebook.php(3): require('C:\wamp\www\Fac...') #2 {main} thrown in C:\wamp\www\Facebook_Twitter_Login 3\Facebook_Twitter_Login\facebook\base_facebook.php on line 19

StevenJ said...

I don't like the idea of leaving the website and then redirecting back.

What should I modify in order for this script to login using a secure popup window like in this website: fitnessmagazine dot com. When I login there, a secure popup window from Facebook, Google, Yahoo appears then after login that popup closes and the website page refreshes and I'm logged in.

Ashique said...

what is facebook api ? how can i manage it or then use it ? will u please give a app id and secret key to run that openid script...thanks

bookmaster said...

I implemented new example and have one question: why on your live demo when clicking Facebook button you get standard fb app premision window, while in my example it is just a login window? Are there different permisions/login types ?

crimsonspark said...

how about requesting for permission with facebook to get the access_token?

lanlan said...

I have found this for a long time. Thanks for sharing!
junior bridesmaid dresses

Diana said...

Thanks a lot! Great!!!

Brijesh Patel said...

Demo is very good but
logout not work properly....
when i click on logout on our site then also not logout....from facebook...

Mac Perts said...

Sir, I having a problem with facebook log out, if i logged out in your application, I'm still log in in my facebook account.

Anonymous said...

sir i am also facing same problem while log out

mayid said...

I don't understand why login-facebook.php file uses twitter vars:$twitter_otoken & $twitter_otoken_secret

In other words, why User Class depends on these two vars. Facebook has nothing to do with that, hasn't it?

$user->checkUser($uid, 'facebook', $username, $email, $twitter_otoken, $twitter_otoken_secret);

So, i'm getting this error:
Notice: Undefined variable: twitter_otoken in /home/guillermo/www/iloby/trunk/public/social/login-facebook.php on line 35

Mayid said...

Well, i solved it declaring them null vars for facebook connect:
$twitter_otoken = $twitter_otoken_secret = null;

mayid said...

Any clue about why i'm getting "Could not authenticate with OAuth" error? This happens in getTwitterData.php, in response to $twitteroauth->get('account/verify_credentials')

mayid said...

Dismiss my last comment. I wasn't setting my app key correctly.

darkermisae said...

Wooow! i've been doing research for weeks about this stuff, this is by far the best tut. ever found. But i have an issue, i finally get to connect to the DB and my FB APP, but it return some error msg -> "Column count doesn't match value count at row 1"

Right after i click the login button!

Anonymous said...

do we need a callback url in twitter if so what would it be? and how about facebook? great job by the way

Post a Comment

Subscribe now!Recent Posts

Categories

Subscribe now!Popular Posts

People Says

@9lessons thank you for the great tutorials, we truly appreciate your contributions to the design community.

Smashing Magazine

Like Me

follow me
products

9lessons labs

9lessons clouds

Android application

Chrome Extension