In this tutorial we will discuss simple php login system with jQuery shake effect, It will give you ability to sign in into the user based system, we will use Ajax to store logged in user data into session.
First of all we need a table with user data, lets create a table named users.
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- Dumping data for table `users`
INSERT INTO `users` (`id`, `username`, `password`, `email`) VALUES
(1, 'hardik', 'e10adc3949ba59abbe56e057f20f883e', 'firstname.lastname@example.org');
We have defined
id as Auto increment, which give user a unique id.
Now let create a file named index.php which will shows our Login form and all logic related to Ajax call.