login system in php mysql

Login System in PHP and MySQL, Complete Registration System With Session: Everyday on the internet we see too many login forms. In other words, user registration system. Most of the website’s registration system built with PHP and MySQL like Facebook, WordPress etc.

Today I will show you how to make MySQL and PHP login system. In fact, I’ll give you the source code. Follow me step by step for creating a secure user registration system with PHP and MySQL. This system has a “session” feature. In other words, it is a secure login PHP system.

Login System in PHP and MySQL, Complete Registration System With Session Step By Step Guide:

You Have to Create These, Step by Step Guide:

  1. Database and Insert Table
  2.  Registration Form
  3. Login Form
  4. Connect to Database
  5. Authentication
  6. Index page
  7. Dashboard Page
  8. Logout
  9. CSS File for Styling

Special Note: I gave Database, files, classes names from my own choice. you can change these names in your case.

Create a Database and Table

First, you have to create a database. So, Login in your Cpanel or localhost then goes to phpmyadmin. For create database goto to database section and type database name “register” and click on create.

create database in phpmyadmin

After creating database successfully, Now create Database table, You can create table manually If you confuse about that. No Problem, Click on your Database named “register” then go “Query ” section paste this code and click on submit query.

submit mysql query

SQL Query Code:

Connect To Database

Create a file named “db.php” and paste these codes below. This function is for Connect database to this program.

db.php

Create Authentication File for Secure

Create a file named “auth.php”  and paste codes below. This file creates session, for security and store cookies.

auth.php

Create Registration Page

Now you have to create a registration form. Basically, this form built-in HTML & CSS and functions are in PHP.

register php mysql

 

Create a Php file named “registration.php” and paste these codes and save it.

registration.php

Create Login Page

Now create a file and save it with named “login.php” and paste the following codes given below.

login.php

Create an Index Page

What after login? of-course index page. So, create a page named “index.php”  and pastes these codes give below.

index.php

Now Create a Dashboard Page

After created index page now you have create dashboard page. Basically, This is Profile Section. Now Create a file named “dashboard.php” and paste these codes.

dashboard.php

Create Logout File

Basically, this file is to destroy session and redirect to index page. So, create a file named “logut.php” and paste these codes.

logout.php

Now Finally Give Style with CSS On This login PHP system

The last thing create a CSS file to give style this program. Without CSS this program is only a frame. Create a file named style.css and paste these codes.

style.css

Now This PHP login program is done. Hope you guys enjoyed this article and this source code and tutorial will helpful for you. Thanks for Visiting my blog.

106 COMMENTS

  1. Nah postingan kali ini sangat bermanfaat, saya sering berkunjung dan membaca postingan disini.

    Emang keren-keren kontennya. Salah satu blog yang recommended deh.

  2. Woah! I’m really digging the template/theme of this website.

    It’s simple, yet effective. A lot of times it’s
    hard to get that “perfect balance” between superb usability and visual appearance.

    I must say you’ve done a awesome job with this. Also, the blog loads super quick for me on Internet explorer.
    Outstanding Blog!

  3. Google

    Wonderful story, reckoned we could combine some unrelated data, nevertheless truly worth taking a look, whoa did one particular find out about Mid East has got far more problerms too.

  4. Hi there! I could have sworn I’ve visited this web site before but after looking
    at many of the articles I realized it’s new to me. Regardless,
    I’m definitely pleased I came across it and I’ll be book-marking it and checking back
    frequently!

  5. Hi, i think that i noticed you visited my blog thus i got here to go back the choose?.I’m attempting to
    find issues to enhance my website!I suppose its ok to use
    some of your concepts!!

  6. Hello! Someone in my Myspace group shared this site
    with us so I came to look it over. I’m definitely enjoying the
    information. I’m bookmarking and will be tweeting this to my followers!

    Fantastic blog and terrific style and design.

  7. Hi there! This post couldn’t be written any better! Reading through this post reminds me of my previous room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thank you for sharing!

  8. I get pleasure from, result in I discovered just what I used
    to be having a look for. You’ve ended my 4 day long hunt!
    God Bless you man. Have a great day. Bye

  9. Hmm it looks like your website ate my first comment
    (it was extremely long) so I guess I’ll
    just sum it up what I submitted and say, I’m thoroughly enjoying your blog.
    I as well am an aspiring blog writer but I’m still new to everything.
    Do you have any suggestions for inexperienced blog writers?
    I’d certainly appreciate it.

  10. I loved as much as you will receive carried out right here.
    The sketch is tasteful, your authored subject matter stylish.
    nonetheless, you command get got an impatience over that you wish be delivering the
    following. unwell unquestionably come more formerly again since exactly the same nearly a
    lot often inside case you shield this increase.

  11. I’m truly enjoying the design and layout of your website.
    It’s a very easy on the eyes which makes it much more pleasant
    for me to come here and visit more often. Did you hire out a developer to create your
    theme? Excellent work!

  12. Every weekend i used to pay a quick visit this website, because i wish for enjoyment, as this this web site conations genuinely nice funny data too.

  13. lol i can see an OLD mysql there replace
    $result = mysqli_query($con,$query) or die(mysql_error());

    to this
    $result = mysqli_query($con,$query) or die(mysqli_error());

    DONT MESS UP MYSQL WITH mysqli

  14. Hi sir 🙂 I have spend a lot of time to find this… It looks everything is vorking but here is s mall thing… can u tell me why i can’t see the passwords in my db? it just generating a random password. by the way thank you for this work… i spend too much time on searching for right source…

  15. thnqq so much for this amazing……but there seems a small prblm when i use registration page. My registration page is successfully executed but the data is not being stored in data base….though i get user successfully registered….your help would be appriciated.
    thanking you in advance

  16. Hi,
    When I use the login.php, and it get validated, it does not go automatically to the index.php. The page is blank!
    If manually enter index.php it show I am sign in.
    Can you help to resolve the issue.
    Thank you

  17. Everything works well except redirecting to index.php. It shows blank page after login. I hope many of them asking about the same issue. It would be helpful if you could reply. Thank You!

  18. MD5 is insecure password encryption!
    You should use hashing mechannism like bcrypt
    Critical validations are misssing

  19. I am curious to find out whаt blog syѕtem you’re utilizing?
    I’m experiencing somе smalⅼ security issues witһ
    mу latеst website ɑnd I’ɗ likе to find sοmething more safe.

    Do you hаvе anyy solutions?

  20. […] » Visit Now Mar 08, 2019 · Login System in PHP and MySQL, Complete Registration System With Session: Everyday on the internet we see too many login forms.In other words, user registration system. Most of the website’s registration system built with PHP and MySQL like Facebook, WordPress etc.. Today I will show you how to make MySQL and PHP login system.In fact, I’ll give you the source code.Author: Shaan […]

LEAVE A REPLY

Please enter your comment!
Please enter your name here