Login and Registration Script in PHP & Mysqli

In this tutorial i will explain Login and Registration Script in PHP & Mysqli in core process. Login and Registration Script in PHP & Mysqli is very basic and most important part of any web application. Programmer needs this script regularly in his application. We are using mysqli in spite of mysql because mysql is deprecated in latest PHP version.


Download Code Demo
Step 1 :

Create database with any name . Here i created test database. After creation of test database create users table with below sql script. You can copy and paste below script in phpmyadmin sql query.

Step 2 :

Make database connection file connect.php .

Step 3 :

Create registration file where user can register himself. Here you have to make a simple html form with all user input field like username, email, password etc. Here i created register.php file for user registration.

Step 4 :

Make login form where user can validate himself with username and password. Here i created index.php file for login.

Step 5 :

After successful login user goes to dashboard where welcome message shows. Here i created home.php file for this page.

Step 6 :

Create logout page where user can logout after login. In this page you simply destroy all session. Here i created logout.php file for this script.

Step 7 :

Now create your css file for your look and feel for all the page. Here i created style.css for this script.


I hope you understand very well Login and Registration Script in PHP & Mysqli.

If you have any query regarding our tutorial Login and Registration Script in PHP & Mysqli then you can comment.

About the Author: Sanjeev Kumar

Experienced PHP Web Developer and founder of www.codemarts.com. Expert in Codeigniter (MVC), WordPress, JSON, jQuery & HTML5.

1 Comment+ Add Comment

  • This is copy code. Remove your code. Put new fresh code

Leave a comment