PHP Based Login Server for LGL Login System

PHP Based Login Server for LGL Login System

Today I will show you how to set up a web server to store user login credentials for an in-app login system.

Thanks to LGL for providing the Android Studio project.

Downloads

Video Tutorial

Further Details

I recommend using server no. 2 because it is very easy to manage.

Before proceeding, please watch the video tutorial to clear up any doubts.

Hosting Service

I used the free plan of 000webhost.

Creating the Database

Database Creation

Save your database password as it is crucial. Other details can be obtained from the Database Manager.

Editing DB.php

Editing DB.php

Add your data in the correct order to ensure proper functionality.

SQL Code

Get the SQL code from the link provided below:

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";

CREATE TABLE `tokens` (
`Username` varchar(20) NOT NULL,
`Password` varchar(8) NOT NULL,
`StartDate` timestamp NULL DEFAULT NULL,
`EndDate` timestamp NULL DEFAULT NULL,
`UID` varchar(60) DEFAULT NULL,
`Expiry` int(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `tokens` (`Username`, `Password`, `StartDate`, `EndDate`, `UID`, `Expiry`) VALUES
('DVA', '1234', NULL, NULL, NULL, 1);

ALTER TABLE `tokens`
ADD UNIQUE KEY `Username` (`Username`,`Password`);
COMMIT;