Login with Google Account OpenID in php

By: Prem Tiwari | Last Updated: | In: Google, PHP Tutorial

In few months back i had posted an article about Login with facebook account using php, it is most popular on freewebmentor.com. The with minimal line of PHP codes, We can acquire required user information from Google, and use the information to register or login users on click of a button.

demo download.

Create Sample Database Table

Sample database table with columns id, email, oauth_uid, oauth_provider and username.

Directory structure


Connection file to connect with your database.


Index.php Page
Add this code in

Welcome Page

About: Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.

, ,