Today, We want to share with you Ajax Login System with jQuery PHP and MySQLi.In this post we will show you Ajax login form using jQuery, PHP, PDO, MySQL, hear for Simple PHP Login System Using MySQL and jQuery AJAX we will give you demo and example for implement.In this post, we will learn about Ajax Login Form Using jQuery, PHP And MySQL with an example.
Ajax Login System with jQuery PHP and MySQLi
There are the Following The simple About Ajax Login System with jQuery PHP and MySQLi Full Information With Example and source code.
As I will cover this Post with live Working example to develop jQuery Ajax PHP MySQLi Login Form System, so the Simple Ajax Login form with jQuery and PHP for this example is following below.
Step 1 : Create Ajax Login Form
signin_form.php
Ajax Login form using PHP and MySQL Member Login
Step 2 : Database Detials
member table structure in your database
CREATE TABLE IF NOT EXISTS `members` ( `member_id` int(11) NOT NULL AUTO_INCREMENT, `member_fname` varchar(255) NOT NULL, `member_lname` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`member_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2; -- -- Dumping data for table `members` -- INSERT INTO `members` (`member_id`, `member_fname`, `member_lname`, `email`, `password`, `created_at`) VALUES (1, 'Jaydeep', 'PHP', '[email protected]', '$2y$10$8mVSGv/bIGgcvCik9825606241Ml3jqfiirtQG9909816257LG', '2019-10-12 18:09:10');
Step 3 : configuration in Database
Config.php
signin.php
0) { $results['message'] = $responseError; $results['status'] = false; echo json_encode($results); exit; } $statement = $db->prepare("select * from members where email = :email" ); $statement->execute(array(':email' => $_POST['email'])); $row = $statement->fetchAll(PDO::FETCH_ASSOC); if(count($row)>0) { if(!password_verify($_POST['password'],$row[0]['password'])) { $responseError[] = "Member Password is not valid"; $results['message'] = $responseError; $results['status'] = false; echo json_encode($results); exit; } session_start(); $_SESSION['member_id'] = $row[0]['member_id']; $results['redirect'] = "home.php"; $results['status'] = true; echo json_encode($results); exit; } else { $responseError[] = "Email does not match"; $results['message'] = $responseError; $results['status'] = false; echo json_encode($results); exit; }
secure.php
signout'; }
signout.php
session_start(); session_destroy(); header('location: signin.php');
Angular 6 CRUD Operations Application Tutorials
Read :
Summary
You can also read about AngularJS, ASP.NET, VueJs, PHP.
I hope you get an idea about Ajax Login System with jQuery PHP and MySQLi.
I would like to have feedback on my Pakainfo.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.