Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Log in to Facebook and Twitter

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

F acebook and Twitter are getting bigger and bigger in the social networking world, with both networks providing oAuth support. We have developed a login system using Twitter and Facebook. Nowadays, web users are not interested in filling out large registration forms. This script helps you avoid the registration form, which is very useful and easy to integrate.

Database

The sample database user table lists id,email,oauth_uid,oauth_provider and username.

CREATE TABLE users

(

Id INT PRIMARY KEY AUTO_INCREMENT

Email VARCHAR (70)

Oauth_uid VARCHAR (200)

Oauth_provider VARCHAR (200)

Username VARCHAR (100)

Twitter_oauth_token VARCHAR (200)

Twitter_oauth_token_secret VARCHAR (200)

);

This tutorial contains three folders named facebook, twitter, and config, which contain PHP files.

Facebook / / Facebook OAUTH library

Twitter / / Twitter OAUTH library

Config

-- functions.php

-- dbconfig.php / / Database connection

-- fbconfig.php / / Facebook API connection

-- twconfig.php / / Twitter API connection

Index.php

Home.php

Login-twitter.php

Login-facebook.php

GetTwitterData.php

Facebook Settin

You must create an application. Facebook will provide you with app id and app secret id, just modify the following code

Fgconfig.php

Twitter Settin

To create a Twitter application, click here. Some like Facebook Twitter use these modifications to the following code to provide you with the consumer key amd consumer key.

Twconfig.php

Dbconfig.php

Database configuration file.

Login-twitter.php

In the root directory, find the following line in the login-twitter.php code and replace your Web site.

$request_token = $twitteroauth-> getRequestToken ('http:// yourwebsite.com / getTwitterData.php')

Index.php

If you want to modify the existing login page or index page of the Web project, simply use the following code.

/ / HTML Code

Twitter_Login

Facebook_Login

If you have any questions, please comment here.

Thank you,

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report