How to Make Login Form in PHP and MySQL

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • PART 2 : Registration System -- • Complete User Registra...
    PART 3 : PHP Profile System Change Password
    • PHP Profile System C...
    UPDATE: Secure Login system using PHP with MYSQL database
    • Secure Login system us...
    In this video we are going to build Login, Logout and Profile System Using
    PHP,
    MYSQL ,
    HTML and CSS,
    www.youtube.co...
    Source Code
    github.com/cod...
    Login System Tutorial with PHP and MYSQL Database
    Login system using PHP with MYSQL database
    #Login System Using #PHP and #MYSQL
    How To Create A Login System In PHP For Beginners | Procedural MySQLi | PHP Tutorial |

ความคิดเห็น • 475

  • @CodingwithElias
    @CodingwithElias  4 ปีที่แล้ว +13

    👨‍💻 The Source code is under the description
    Please 📝 comment on this video and ❤️ Subscribe

  • @markdanielbriva6122
    @markdanielbriva6122 3 ปีที่แล้ว +31

    I wish you were verbally discussing parts for more understanding for newbies like me. But thank you for this tutorial anyway. It was a great Help. May God bless you 3000 brother

  • @GreenAndSuited
    @GreenAndSuited 3 ปีที่แล้ว +8

    Indian Guy youtube is very helpful and all, but I never realized just how immured I am to having to listen to them till I found your video. Excellent work of being able to show the process without needing narration - it was a pretty chill way to learn. Thank you very much!
    EDIT: Dude, send me your playlist - its so jammable that I'm just boppin my head while typing RN.

    • @CodingwithElias
      @CodingwithElias  3 ปีที่แล้ว +3

      thanks.

    • @Manga4th
      @Manga4th 3 ปีที่แล้ว

      Exactly bro, no need for narration. The video speaks for itself, excellent work

    • @Manga4th
      @Manga4th 3 ปีที่แล้ว

      Exactly bro, no need for narration. The video speaks for itself, excellent work

    • @Manga4th
      @Manga4th 3 ปีที่แล้ว +1

      Exactly bro, no need for narration. The video speaks for itself, excellent work

  • @denizasar87
    @denizasar87 2 ปีที่แล้ว +31

    12:12 Creating DataBase (id , user_name, password, name)
    13:34 Creating db_conn.php
    19:42 Creating home.php → session_start();

  • @user-ow1ml8mk3e
    @user-ow1ml8mk3e 3 ปีที่แล้ว +20

    This is really helpful for my assignment!

  • @jobdominic5894
    @jobdominic5894 2 ปีที่แล้ว +9

    This is tutorial is perfect for us beginners. Thank you very much! it really do helped me a lot! Thanks!

  • @eng.mohamedhassan2496
    @eng.mohamedhassan2496 4 ปีที่แล้ว +4

    great work keep it up bro you will reach one day 100K subscribers and i am one of your subscribers i am Eng.Mohamed Azhari from Somalia am Cisco Engineer, Cloud Engineer like AWS, Azure and OpenStack, also programmer.

  • @mvrsunivers
    @mvrsunivers หลายเดือนก่อน +1

    Thank you brother ❤
    I struggled to learn How to validate From Table 😢After These video I realised Today Thank you so much ❤

  • @owlyanin7333
    @owlyanin7333 2 ปีที่แล้ว +5

    I had so many errors because I used different variables and I am confused 🤯 hahaha, but still, in the end made it, thank you so much for this.I learned many things. This is very big help for our school proj.

    • @backofmyhouse
      @backofmyhouse 9 หลายเดือนก่อน

      I feel that. Typically now, I use the same variables while following the tutorial and then changing them after while I customize the result.

  • @tellydramapage477
    @tellydramapage477 ปีที่แล้ว

    Amazing...kab se dhoond rahi thi yaar aisa connectivity wala video..finally got this one...

  • @Manga4th
    @Manga4th 3 ปีที่แล้ว +12

    I’m saying this from the bottom of my heart: THANK YOU VERY MUCH!!!

  • @josephsmithbermas6589
    @josephsmithbermas6589 ปีที่แล้ว +5

    This tutorial is awesome its easy to understand and he also provide a source code. Thank you very much man!!

  • @theNorixius
    @theNorixius 4 ปีที่แล้ว +22

    Absolutely perfect, every single step in this video worked flawlessly for me. Subbed and liked!! would you ever consider a playlist of tutorials on learning php or other coding languages? sorry if you have already done this.

  • @Not_Aran8276
    @Not_Aran8276 3 หลายเดือนก่อน +3

    Not sure if you'll read this, and it is unusual compared to other comments, but I actually like the song. What is it? 2005 Classic Hard Trance vibes to it.

  • @AvishkaIshan-kk1eh
    @AvishkaIshan-kk1eh ปีที่แล้ว +1

    Thank you this video is very help for my project

  • @Yuri-qr7ml
    @Yuri-qr7ml 10 หลายเดือนก่อน

    Was able to get along well with this and I have very limited experience as I only started this year. All I know is some HTML and CSS
    For the button to logout I only had text as display even with text-decoration: none;
    text-decoration: none!important;
    This did fix it for me but I don't know why it was there anyway. Thanks for the guide!

    • @CodingwithElias
      @CodingwithElias  10 หลายเดือนก่อน

      Try by Hard refreshing, for Chrome hold down Ctrl and shift and then press R

  • @christalyndianeramos9037
    @christalyndianeramos9037 ปีที่แล้ว +1

    Thank you elias! this video help me for my laboratory.

  • @muhammadsyukry6650
    @muhammadsyukry6650 ปีที่แล้ว +1

    Thank you it really help me, this tutorial perfect for us beginners on PHP and MySQL

  • @wasanthakarunathilake8821
    @wasanthakarunathilake8821 9 หลายเดือนก่อน +1

    you are the best for beginners really appreciate ❤️

  • @shaikayesha7113
    @shaikayesha7113 2 ปีที่แล้ว +1

    Such a wonderful video.
    It helped me a lot in doing my project. Thank you sooooooooo much ☺️☺️☺️

  • @movielink4950
    @movielink4950 3 ปีที่แล้ว +1

    Wow I really proud of you.
    This video solve my problem.
    It is Best video.

  • @krenarshala5813
    @krenarshala5813 3 ปีที่แล้ว +3

    Very nice thank work Elias for learning me this simple . You just safe me from givin up on this .

  • @marikitdulorzo5422
    @marikitdulorzo5422 ปีที่แล้ว +1

    Wow good coder i learn alot i love you

  • @noelnyamunokora4676
    @noelnyamunokora4676 ปีที่แล้ว +1

    this was an easy tutorial to understand, .. thank you

  • @wahyueko7534
    @wahyueko7534 3 ปีที่แล้ว +1

    thank you very much, now my daily task is complete

  • @althearociobm
    @althearociobm 3 ปีที่แล้ว +1

    I can't stop crying, you helped me so much, thank you very very much. ♥ i love you

  • @juliannagaertner7051
    @juliannagaertner7051 3 ปีที่แล้ว +1

    Helpful tutorial! The music sounds like a cat purring aggressively

  • @AvishkaIshan-kk1eh
    @AvishkaIshan-kk1eh ปีที่แล้ว +1

    From sri lanka🇱🇰🇱🇰🇱🇰

  • @gerasmiodanica1033
    @gerasmiodanica1033 3 ปีที่แล้ว +3

    You’re a life saver. Thank you Elias.🙏

  • @trabrouss
    @trabrouss 3 ปีที่แล้ว

    It will be very interesting to speak in the video to be able to behave more well
    thank you for all his lesson

  • @kai_gaming236
    @kai_gaming236 3 ปีที่แล้ว +1

    Wow i really learn a lot thank you bro i hope you continue this project.

  • @filsana.1560
    @filsana.1560 4 ปีที่แล้ว +4

    I was the thousandth sub, congrats.

  • @shahulhameedmohamedbatcha2804
    @shahulhameedmohamedbatcha2804 3 ปีที่แล้ว +1

    Thanks a lot for your wonderful video and resources.

  • @BrainBoostAI820
    @BrainBoostAI820 ปีที่แล้ว +1

    Thank you so much! Probably the best and most enjoyable tutorial for me. You earnt a sub.

  • @kannapipa2270
    @kannapipa2270 3 ปีที่แล้ว +2

    I followed your tutorial and it works, but how can I create an api for this? can you give me some hints or sample on how can I achieve an api for this.

  • @EditedSong..
    @EditedSong.. 7 หลายเดือนก่อน

    Thank you very much man. because of your tutorial i can make my first login web. :D

  • @auliaausath7241
    @auliaausath7241 ปีที่แล้ว

    Thank you, this tutorial is very helpful and can be used as a reference for my project

  • @TheSathiskpv
    @TheSathiskpv 3 ปีที่แล้ว

    Amazing Video very clear steps Thanks lot...

  • @medjl6083
    @medjl6083 2 ปีที่แล้ว

    You are the best with extention mysql i

  • @franckkamga2399
    @franckkamga2399 2 ปีที่แล้ว +1

    Thanks alot. Really helped me. Please can you do a sign up page for this same login page?

  • @ankushbhagatofficial
    @ankushbhagatofficial ปีที่แล้ว

    This tutorial helped me lot, thanks bro.

  • @fwitz2017
    @fwitz2017 3 ปีที่แล้ว +1

    QUESTION @ 18:00 why do you validate the username and password again with the if statement? Doesn't the SELECT statement do that already?

    • @CodingwithElias
      @CodingwithElias  3 ปีที่แล้ว +1

      yeah. you're right but it's not going to be case sanative in the way. thanks I appreciate your comment

    • @fwitz2017
      @fwitz2017 3 ปีที่แล้ว +1

      @@CodingwithElias Ah, ok! Thanks Elias

  • @_etg
    @_etg 3 ปีที่แล้ว +1

    thanks now i can finally make login

  • @deetookfree
    @deetookfree ปีที่แล้ว

    This is what I am looking for. It's perfect!
    Thks

  • @laovoyage
    @laovoyage ปีที่แล้ว

    Very useful video and thanks for sharing

  • @panmeijianthuingam7962
    @panmeijianthuingam7962 3 หลายเดือนก่อน +1

    It helps me a lot 👍👍👍

  • @PinoyDubbedMaster
    @PinoyDubbedMaster 3 ปีที่แล้ว +1

    Amazing. 100% working tutorial

  • @richmondng3567
    @richmondng3567 3 ปีที่แล้ว +4

    This is the perfect login logout tutorial!

  • @jalilsumangan3322
    @jalilsumangan3322 3 ปีที่แล้ว +2

    16:32 isn't working on me its says mysqli_num_rows() expects parameter 1 to be mysqli_result how do I fix this?

    • @CodingwithElias
      @CodingwithElias  3 ปีที่แล้ว +1

      check your PHP version it should be php 7 or

    • @vatbros7162
      @vatbros7162 3 ปีที่แล้ว

      @@CodingwithElias my php version > 7

    • @vatbros7162
      @vatbros7162 3 ปีที่แล้ว

      @@CodingwithElias help please

    • @CodingwithElias
      @CodingwithElias  3 ปีที่แล้ว

      @@vatbros7162 check out the source code under the description

    • @shriharimokashi8274
      @shriharimokashi8274 3 ปีที่แล้ว +3

      Uncaught TypeError: mysqli_num_rows(): Argument #1 ($result) must be of type mysqli_result, bool given in D:\xaamp\htdocs\phpproject\login.php:28 Stack trace: #0 D:\xaamp\htdocs\phpproject\login.php(28): mysqli_num_rows(false) #1 {main} thrown in D:\xaamp\htdocs\phpproject\login.php on line 28

  • @MsBoolo
    @MsBoolo 3 ปีที่แล้ว +2

    Thank you very much for this tutorial and providing the source code. It helps me so much.

  • @jakubdrazkowski5952
    @jakubdrazkowski5952 ปีที่แล้ว +1

    Love you man! I am amazed with your skills!

  • @melalama8693
    @melalama8693 3 ปีที่แล้ว +1

    Hi I am really new to MySQL and PHP. I understood that everything you showed here. But I am not sure how can I get into the PHPMyAdmin page after logging in. I have a total of 5 users and what I need to make sure is, that each user will only be able to access the data they input. Can you please let me know or direct me to your tutorials if you have any.

    • @CodingwithElias
      @CodingwithElias  3 ปีที่แล้ว

      Check out the link in the description

  • @shunseditz3641
    @shunseditz3641 13 วันที่ผ่านมา

    everything is good but i have a question, i want to make the register form now , so should i continue with those files or what?

  • @medadahmed6339
    @medadahmed6339 3 ปีที่แล้ว

    This was really helpful, please can you do a video on changing of password

    • @CodingwithElias
      @CodingwithElias  3 ปีที่แล้ว

      Yeah, why not I'll do it soon, thanks bro.

  • @AllaboutCats2024
    @AllaboutCats2024 2 ปีที่แล้ว +1

    Sir I have an wierd error, whenever I login email &password it's give me error "invalid email & password" any solution Sir I even copy from my Sql db still same error any solution I will be thankful to you

  • @angelocarreon8391
    @angelocarreon8391 3 ปีที่แล้ว +1

    How about if both Username and Password are empty, how to add an error message saying "Username and Password required" instead of only "Username required"?

    • @CodingwithElias
      @CodingwithElias  3 ปีที่แล้ว +4

      if (empty($uname) && empty($pass)) {
      header("Location: index.php?error=User Name & Password required");
      exit();
      }
      else if(empty($uname)) {
      header("Location: index.php?error=User Name is required");
      exit();
      }else if(empty($pass)){
      header("Location: index.php?error=Password is required");
      exit();
      }else{

  • @ekiyann
    @ekiyann 3 ปีที่แล้ว +1

    thanks teacher

  • @jeremytiempo5365
    @jeremytiempo5365 3 ปีที่แล้ว +1

    after i login i stucked at a white page(login.php) not continuing to home.php
    how can i resolve this..?

  • @madhumitharaveendran2947
    @madhumitharaveendran2947 ปีที่แล้ว

    Thank you so much very helpful....

  • @v.rflexel1552
    @v.rflexel1552 3 ปีที่แล้ว +1

    everything was going smooth, then I started encountering errors with mysqli_num_rows() and mysqli_fetch_assoc(). I reviewed the code in the description but did not help. after researching it, it seems it is a common problem and its due to those functions no longer being available in the recent php update, what are some alternatives, or replacements we can use. These are the only things holding me back from completing. and it reads the error "Fatal error: Uncaught TypeError: mysqli_num_rows(): Argument #1 ($result) must be of type mysqli_result, bool given in C:\xam..." please help.

    • @CodingwithElias
      @CodingwithElias  3 ปีที่แล้ว

      it works fine on PHP 7
      maybe reinstall your xampp server

  • @ourmathiass
    @ourmathiass 3 ปีที่แล้ว +2

    Thankyou,, work 😭🤲

  • @jiddujahd
    @jiddujahd 2 ปีที่แล้ว +1

    thanks...
    verry good bro

  • @musubirebashir5276
    @musubirebashir5276 2 ปีที่แล้ว

    So perfect and amazing, thank very much

  • @sarahmohd9198
    @sarahmohd9198 3 ปีที่แล้ว +1

    Hi, your video is helpful for my assignment. Thanksss...anyway,can you show on how to make full website/apps using php mysql with html css?

  • @jeremiahmugerwa9669
    @jeremiahmugerwa9669 3 ปีที่แล้ว +1

    THANK YOU A LOOOT!!!! You helped to come further with my project. Thank you.

  • @rwlia1975
    @rwlia1975 2 ปีที่แล้ว +1

    very helpful... thanks...

  • @khadijatibrahim9660
    @khadijatibrahim9660 ปีที่แล้ว

    💯 perfect....pls how can I implement blowfish algorithm and Aes algorithm for storing files using php

  • @ujjawalsingh3350
    @ujjawalsingh3350 3 ปีที่แล้ว +1

    Thanks a lot for making this video

  • @alexmaina6853
    @alexmaina6853 2 ปีที่แล้ว +1

    Best video ever, no errors

  • @QWERTYY310
    @QWERTYY310 4 ปีที่แล้ว +3

    Example if I create a new page "home" just write zzz.com/home and you can skip the login page.... ):

    • @CodingwithElias
      @CodingwithElias  4 ปีที่แล้ว +2

      No, You can't skip as long as you put session stuff in there like
      ------------
      YOUR Page Content
      -----------------

  • @user-pw7ye7gl6n
    @user-pw7ye7gl6n ปีที่แล้ว

    Thank you... It is a BIG help...

  • @firenub
    @firenub 11 หลายเดือนก่อน

    For a biggner it was quite confusing though still managed to understand few things but still i am not able to run my php file in browser

    • @CodingwithElias
      @CodingwithElias  11 หลายเดือนก่อน +1

      Good job keep going 👍

  • @norbert7445
    @norbert7445 11 หลายเดือนก่อน

    I have a problem because everything in XAMP works for me and when I want to transfer it to the hosting server, I cannot log in as a user in the database.

    • @CodingwithElias
      @CodingwithElias  11 หลายเดือนก่อน

      Check database configuration file

  • @zafrihaikal8926
    @zafrihaikal8926 3 ปีที่แล้ว +1

    hello, I follow your sources. But when i try to login. It keep going to the same page ( Index ). After i remove php script in Home.php, It can be login.
    How do i find the problem and where do i can fix that problem? Any suggestion?

    • @CodingwithElias
      @CodingwithElias  3 ปีที่แล้ว

      Watch my new video. called "Secure Login system using PHP with MYSQL database"

  • @Zakariyamuud113
    @Zakariyamuud113 9 หลายเดือนก่อน

    hello elias i have tried running the login button but it does not redirect me to the home page i have even copied and pasted your code but it still wont direct me to the home page it just refreshes and nothing happens could you help me please.Thank you

    • @CodingwithElias
      @CodingwithElias  8 หลายเดือนก่อน

      Check out part 2 video. The link is under the description

  • @gwapongpusa5682
    @gwapongpusa5682 3 ปีที่แล้ว

    Thankyou For this Video💓 like and downloaded 💓

  • @user-ro1ue2oy8q
    @user-ro1ue2oy8q 8 หลายเดือนก่อน

    I make it but I have problem that is the passwrd not matched same my password that I insert in the form also insert diffrent password in database .....can you help me in this

  • @aleksandarmartinov5073
    @aleksandarmartinov5073 2 ปีที่แล้ว

    I dont have sign % in URL like you,just blank spaces . But if i write it in header it is shown as error message when wrong input is for example. How to fix that ?

  • @budisantotso1958
    @budisantotso1958 3 ปีที่แล้ว +1

    hello elias thanks you are great

  • @anusuyar8423
    @anusuyar8423 2 ปีที่แล้ว +1

    Too good explanation

  • @user-rc8wr5ir7z
    @user-rc8wr5ir7z 9 หลายเดือนก่อน +1

    dil se dhanyawad

  • @revelinohaseb5947
    @revelinohaseb5947 2 ปีที่แล้ว +1

    Parse error: Unclosed '{' on line 10 in C:\Users\User\Documents\BIS YEAR 3\XA\htdocs\Login-Form\index.php on line 23. Please help out I've followed the code accordingly but I keep getting that error

    • @CodingwithElias
      @CodingwithElias  2 ปีที่แล้ว +1

      Check out the source code under the description

  • @Giovanni-lw7xg
    @Giovanni-lw7xg 3 ปีที่แล้ว +1

    great tutorial ! what if we want to add admin function?

    • @CodingwithElias
      @CodingwithElias  3 ปีที่แล้ว

      check out my multi user login system on this channel 👍

    • @ompsrkash2242
      @ompsrkash2242 2 ปีที่แล้ว

      @@CodingwithElias ea FCC TV tc sq tc

  • @alexiszapata9766
    @alexiszapata9766 3 ปีที่แล้ว +1

    thank you for your wonderful work

  • @pappukumarthakurapcoaching4120
    @pappukumarthakurapcoaching4120 3 ปีที่แล้ว

    Hello sir jab koi bhi form fillup karte hai to submit karne ke baad wo previous/pdf kaise banta hai jo humlog print karte hai wo kaise kar sakte plz sir cooding kare aur apne TH-cam channel pe share kare sir

  • @nidhipatil6070
    @nidhipatil6070 2 ปีที่แล้ว

    sir its displaying this error while saving the database #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(`id` INT NOT NULL , `username` VARCHAR(255) NOT NULL , `password` VARCHAR(25...' at line 1

  • @SHAHSAMINYASAR
    @SHAHSAMINYASAR ปีที่แล้ว

    THANKS A MILLION...LOTS OF LOVE AND RESPECT!!!!

  • @userj-s2000
    @userj-s2000 ปีที่แล้ว

    At 21:15 when you set the if statement to ===1 that means one user only right ? Or

    • @CodingwithElias
      @CodingwithElias  ปีที่แล้ว

      that means the username is must be unique

    • @userj-s2000
      @userj-s2000 ปีที่แล้ว

      @@CodingwithElias ah didnt see it that way, i was getting an error, but when debugging something wasnt right with the second $row in the sqldatabase, thanks for your fast reply, i finished it and applied some header and footer + session.php files

  • @narbhi3273
    @narbhi3273 4 ปีที่แล้ว +1

    sir. when i sent my login files to my friends (followed your code), it says "incorrect username & password" for them. but its only me who can log in successfully. how can i fix this sir? :(

    • @CodingwithElias
      @CodingwithElias  4 ปีที่แล้ว +1

      check out the source code under the description

  • @notme-ts3gt
    @notme-ts3gt 7 หลายเดือนก่อน

    What did you use to style your website?

  • @malekbellaaj4756
    @malekbellaaj4756 4 หลายเดือนก่อน

    thaaaaaaaaaaaank you for this and for the code source thank you it worked

  • @abdirizaknouh8653
    @abdirizaknouh8653 2 ปีที่แล้ว

    what is't cooled the application u use for the color?

  • @irfanrafiq642
    @irfanrafiq642 3 ปีที่แล้ว

    i am stuck at 10:52 ..where you add an error msg in form .i have tried everything chekced all the code same as yours no error msg but my error box doesnt show up on the form .please help.thnanks

    • @CodingwithElias
      @CodingwithElias  3 ปีที่แล้ว

      if it's not crear check my new video called "Secure Login system using PHP with MYSQL database"

  • @tonmeelmans7307
    @tonmeelmans7307 ปีที่แล้ว

    Hi Elias good work thanks voor de video

  • @jaysonpaglinawan332
    @jaysonpaglinawan332 2 ปีที่แล้ว

    Sir can you show us how to make a stored procedures

    • @CodingwithElias
      @CodingwithElias  2 ปีที่แล้ว

      I've video on my channel in this topic, check it out. Thanks for your comment

  • @atheist6430
    @atheist6430 ปีที่แล้ว +1

    Thank you very much bro❤❤❤you saved my internal marks🥹🥹

    • @tkdyt0674
      @tkdyt0674 11 หลายเดือนก่อน

      are you from new zealand? I have internal assessments here

  • @masonyeoh3101
    @masonyeoh3101 2 ปีที่แล้ว

    how you able to do this 23:40, cannot change page by change the URL?? which part of code? Thanks

  • @mr.george5370
    @mr.george5370 3 ปีที่แล้ว +1

    This is awesome!! Thank you!

  • @rvrxs7693
    @rvrxs7693 ปีที่แล้ว

    Hello! For some reason changing properties in style.css has no effect on the php pages. What can i do about this?

  • @thetinkertechlab
    @thetinkertechlab 2 หลายเดือนก่อน +1

    BE CAREFUL using this software in a production environment (Anywhere public basically). If the database gets breached, all stored passwords will be exposed as they are stored in plaintext! Passwords should NEVER be stored this way in a database, ALWAYS use PHP functions like password_hash() and password_verify()