In this below example i shown to create database and table manually and insert the data manually in database. index.php shows the login form design, login.php is the main php code to check the username and password is valid or not. If it is correct home.php file will shown to the client, otherwise the error will displayed to the client.
Create the database
create database sanwebcorner ;
Create the table
CREATE TABLE IF NOT EXISTS `login` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`UserName` varchar(200) NOT NULL,
`Password` varchar(200) NOT NULL,
`FName` varchar(200) NOT NULL,
`LName` varchar(200) NOT NULL,
PRIMARY KEY (`id`)
);
insert the data:
INSERT INTO `login` (`id`, `UserName`, `Password`, `FName`, `LName`) VALUES
(1, ‘sandil’, ‘sandil’, ‘sandil’, ‘sand’),
(2, ‘jk’, ‘jk’, ‘Naveen’, ‘benny’);
