Skip to content
pakainfo

Pakainfo

Web Development & Good Online education

  • Home
  • Blog
  • Categories
  • Tools
  • Full Form
  • Guest Post
    • Guest Posting Service
  • Advertise
  • About
  • Contact Us

Login with Facebook and Twitter using PHP

July 5, 2019 Pakainfo Technology, php, Programming Leave a comment

Today, We want to share with you Login with Facebook and Twitter using PHP.In this post we will show you how to get user information from facebook in php, hear for Best Practice Login With Facebook, Twitter, Google we will give you demo and example for implement.In this post, we will learn about MyLogin: Authenticate users using Facebook, Twitter, Google using PHP with an example.

Login with Facebook and Twitter using PHP

Contents

  • Login with Facebook and Twitter using PHP
    • Setup Database
    • Step 1 Facebook Setup
    • Step 2 Twitter Setup Devloper Account
    • Read
    • Summary
    • Related posts

There are the Following The simple About Login with Facebook and Twitter using PHP Full Information With Example and source code.

As I will cover this Post with live Working example to develop php login with facebook google twitter, so the facebook login signup in php code for this example is following below.

Setup Database

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)
);

facebook,twitter with config settings

facebook //Facebook OAUTH library
twitter //Twitter OAUTH library
config
-- functions.php 
-- dbconfig.php 
-- fbconfig.php 
-- twconfig.php 
index.php
home.php
signin-twitter.php
signin-facebook.php
getTwitterData.php

Step 1: Facebook Setup

We have to make a simple web based define or devloper a application. Facebook will provide We simple app id as well as simple create app secret id, just update and changes following source code.

fgconfig.php

<?php
define('APP_ID', 'Facebook APP ID');
define('APP_SECRET', 'Facebook Secret ID');
?>

Step 2: Twitter Setup Devloper Account

simple step by step you have a a twitter web based application click here. as well as you like Facebook Twitter provide you simple copy this consumer key as well as consumer secret key using these update following source code.

twconfig.php

<?php
define('YOUR_CONSUMER_KEY', 'Setup_your_main_shjdsh555_Twitter Key');
define('YOUR_CONSUMER_SECRET', 'Setup_x56556jshjhjhjfdEE5445e5rTwitter Secret Key');
?>

dbconfig.php

PHP simple Database configuration file.

<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'atmiya_25989');
define('DB_PASSWORD', '[email protected]');
define('DB_DATABASE', 'authTutorials');
$db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
?>

signin-twitter.php

In main home root based folder find out the below simple line at signin-twitter.php source code as well as replace pakainfo.

Also Read This 👉   PHP CodeIgniter Twitter Login Steps - Full Code

$request_token = $twitteroauth->getRequestToken('https://www.pakainfo.com/getTwitterData.php');

index.php

If We need to simple update/change my web based project existing signin or index main pages, just use following simple below source code.

<?php
session_start();
if (isset($_SESSION['id'])) {
	header("location: home.php");
}
if (array_key_exists("signin", $_GET))
{
	$oauth_provider = $_GET['oauth_provider'];
	if ($oauth_provider == 'twitter')
	{
		header("Location: signin-twitter.php");
	}
	else if ($oauth_provider == 'facebook')
	{
		header("Location: signin-facebook.php");
	}
}
?>
//HTML source Code
<a href="?signin&oauth_provider=twitter">Login In Twitter</a>
<a href="?signin&oauth_provider=facebook">Login In Facebook</a>

Web Programming Tutorials Example with Demo

Read :

  • Jobs
  • Make Money
  • Programming

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Login with Facebook and Twitter using PHP.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Related posts:

  1. Login with Facebook and Twitter
  2. PHP CodeIgniter Twitter Login Steps – Full Code
  3. Social Integration with Facebook Twitter and Google using PHP
  4. how to make a login page in html with database?
  5. Multiple image slider in html source code
  6. How To Create Image Hover Overlay Effects?
  7. How To Create Social Media icons footer using bootstrap?
Best Practice Login With Facebookfacebook login signup in php codegooglehow to get user information from facebook in phphow to integrate facebook api in phplogin with facebook php mysqllogin with social media in phplogin with twitter in phpLogin with twitter using phpphp login with facebook google twitterTwitteruse facebook login for my website

Post navigation

Previous Post:jquery $.inArray Method with Example
Next Post:Laravel Twitter Typeahead integration

Advertise With Us

Increase visibility and sales with advertising. Let us promote you online.
Click Here

Write For Us

We’re accepting well-written informative guest posts and this is a great opportunity to collaborate.
Submit a guest post to [email protected]
Contact Us

Freelance web developer

Do you want to build a modern, lightweight, responsive website quickly?
Need a Website Or Web Application Contact : [email protected]
Note: Paid Service
Contact Me

Categories

3movierulz (64) Ajax (464) AngularJS (377) ASP.NET (61) Bio (109) Bollywood (108) Codeigniter (175) CSS (98) Earn Money (93) Education (63) Entertainment (130) fullform (87) Google Adsense (64) Highcharts (77) History (40) Hollywood (109) JavaScript (1359) Jobs (42) jQuery (1423) Laravel (1088) LifeStyle (53) movierulz4 (63) Mysql (1035) Mysqli (894) php (2133) Programming (2345) Python (99) Software (178) Software (90) Stories (98) tamilrockers (104) Tamilrockers kannada (64) Tamilrockers telugu (61) Tech (147) Technology (2416) Tips and Tricks (130) Tools (214) Top10 (506) Trading (95) Trending (76) VueJs (250) Web Technology (113) webtools (200) wordpress (166) World (343)

A To Z Full Forms

Access a complete full forms list with the meaning, definition, and example of the acronym or abbreviation.
Click Here
  • Home
  • About Us
  • Terms And Conditions
  • Write For Us
  • Advertise
  • Contact Us
  • Youtube Tag Extractor
  • Info Grepper
  • Guest Posting Sites
  • Increase Domain Authority
  • Social Media Marketing
  • Freelance web developer
  • Tools
Pakainfo 9-OLD, Ganesh Sco, Kothariya Ring Road, Chokadi, Rajkot - 360002 India
E-mail : [email protected]
Pakainfo

© 2023 Pakainfo. All rights reserved.

Top
Subscribe On YouTube : Download Source Code
We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype Guest Posting Sites