How to Make Login Form in PHP and MySQL

Поделиться
HTML-код
  • Опубликовано: 30 сен 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 |

Комментарии • 478

  • @denizasar87
    @denizasar87 2 года назад +32

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

  • @CodingwithElias
    @CodingwithElias  4 года назад +13

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

  • @Not_Aran8276
    @Not_Aran8276 4 месяца назад +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.

  • @markdanielbriva6122
    @markdanielbriva6122 4 года назад +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

  • @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()

  • @羊祺-d7k
    @羊祺-d7k 4 года назад +20

    This is really helpful for my assignment!

  • @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
      -----------------

  • @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.

  • @jobdominic5894
    @jobdominic5894 2 года назад +9

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

  • @GreenAndSuited
    @GreenAndSuited 3 года назад +9

    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

  • @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

  • @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..?

  • @mvrsunivers
    @mvrsunivers 2 месяца назад +1

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

  • @ProviderKnowledge
    @ProviderKnowledge 9 месяцев назад +1

    thanks

  • @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

  • @iqmathsworld845
    @iqmathsworld845 3 года назад +1

    Not a perfect way for making login form. You have to create css before complete the coding.very bad 👎for beginners.

    • @CodingwithElias
      @CodingwithElias  3 года назад +1

      I'll fix that in the future video's, thanks for your comment

    • @vinay_dias
      @vinay_dias 3 года назад

      It's mentioned php and MySQL it's for ppl who already know frontend and trying hook it up with a backend for your so called css queries watch a front end tutorial 👍🏻

  • @howaboutme990
    @howaboutme990 Год назад +1

    are you really? *unmae: root (what's the code?)
    ¯\_(ツ)_/¯

    • @CodingwithElias
      @CodingwithElias  Год назад

      It's just tutorial. I'm just making things simple, for learning purpose

    • @howaboutme990
      @howaboutme990 Год назад

      @@CodingwithElias it will be troubleshooting for newbie bro

  • @ekiyann
    @ekiyann 3 года назад +1

    thanks teacher

  • @Manga4th
    @Manga4th 3 года назад +12

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

  • @istvanmeszaros4370
    @istvanmeszaros4370 15 дней назад +1

    Thank you! 🙂

  • @sousoususu
    @sousoususu Год назад +1

    Thank you so muchhhhhhhhhhhhhhhhhhhhhhhh

  • @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.

  • @lifeofart3189
    @lifeofart3189 2 года назад +1

    Bro why don't auto complate html tags in php

  • @panmeijianthuingam7962
    @panmeijianthuingam7962 4 месяца назад +1

    It helps me a lot 👍👍👍

  • @lotrlmao1648
    @lotrlmao1648 2 года назад +2

    Is there any Swinburne Student here ?

  • @jiddujahd
    @jiddujahd 2 года назад +1

    thanks...
    verry good bro

  • @revelinohaseb5947
    @revelinohaseb5947 3 года назад +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

  • @제마이마
    @제마이마 6 месяцев назад +1

    thank you so much!

  • @BlueSkyUniversity
    @BlueSkyUniversity 4 месяца назад +1

    Elias 😡you're
    Great

  • @emericthirion3113
    @emericthirion3113 Месяц назад +1

    let him cook

  • @TharunKumar-or9ip
    @TharunKumar-or9ip 10 месяцев назад

    I dont know why, but I am getting error at $result = mysqli_query($conn, $sql);
    Please anyone help me solving this.

  • @AvishkaIshan-kk1eh
    @AvishkaIshan-kk1eh Год назад +1

    Thank you this video is very help for my project

  • @isaiahlacuarin3653
    @isaiahlacuarin3653 11 месяцев назад +1

    I hate how my VS keep showing wroNGLY but it dOES HeLP HAHAHA

  • @filsana.1560
    @filsana.1560 4 года назад +4

    I was the thousandth sub, congrats.

  • @jackionendino4293
    @jackionendino4293 2 года назад +1

    thankyou so much love, deserve a sub

  • @ermanfaminiano9756
    @ermanfaminiano9756 2 года назад

    How to resolve this "#1062 - Duplicate entry '0' for key 'PRIMARY'".

  • @marikitdulorzo5422
    @marikitdulorzo5422 Год назад +1

    Wow good coder i learn alot i love you

  • @payamabdulbasitabdullah1848
    @payamabdulbasitabdullah1848 4 года назад +4

    thank you so muchhhh

  • @ourmathiass
    @ourmathiass 3 года назад +2

    Thankyou,, work 😭🤲

  • @SmolWolfess
    @SmolWolfess 8 месяцев назад +1

    thank you dude

  • @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"

  • @shriharimokashi8274
    @shriharimokashi8274 3 года назад +1

    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 on line

    • @CodingwithElias
      @CodingwithElias  3 года назад

      Checkout the source code under the description

  • @الشاعردفعاللهيوسف
    @الشاعردفعاللهيوسف 9 месяцев назад

    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

  • @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

  • @lordarthur1611
    @lordarthur1611 4 года назад +6

    14:35

  • @jakubdrazkowski5952
    @jakubdrazkowski5952 Год назад +1

    Love you man! I am amazed with your skills!

  • @BrainBoostAI820
    @BrainBoostAI820 Год назад +1

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

  • @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 10 месяцев назад

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

  • @krenarshala5813
    @krenarshala5813 3 года назад +3

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

  • @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{

  • @_B4D3r_X
    @_B4D3r_X 2 года назад

    Login in mobile roblox

  • @itchannel5440
    @itchannel5440 3 года назад +1

    Bro I have droughts in php how can I contact you

  • @movielink4950
    @movielink4950 3 года назад +1

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

  • @ToshanKanwar-d8e
    @ToshanKanwar-d8e 10 месяцев назад +1

    dil se dhanyawad

  • @josephsmithbermas6589
    @josephsmithbermas6589 2 года назад +5

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

  • @terd3011
    @terd3011 6 месяцев назад +1

    nice

  • @umie8278
    @umie8278 Год назад +1

    🤓 Thanks

  • @macslim6950
    @macslim6950 2 года назад +1

    Thank you

  • @wasanthakarunathilake8821
    @wasanthakarunathilake8821 10 месяцев назад +1

    you are the best for beginners really appreciate ❤️

  • @DanielFekadu-jm9re
    @DanielFekadu-jm9re 6 месяцев назад +1

    pleace put on description login form

  • @muhammadsyukry6650
    @muhammadsyukry6650 Год назад +1

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

  • @LovePromoter
    @LovePromoter 3 года назад +1

    thank you bro

  • @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.

  • @soufianegediani407
    @soufianegediani407 4 года назад +1

    sir pls help '"Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result"

    • @CodingwithElias
      @CodingwithElias  4 года назад

      Hi! thanks for your comment
      check out the source code under the description.

    • @gemmawalsh3326
      @gemmawalsh3326 3 года назад

      How did you fix this? Mine has done the same so wont run

  • @ulala7535
    @ulala7535 3 года назад +2

    Thank youuuuuuu, you just saved my ass :-)

  • @althearociobm
    @althearociobm 3 года назад +1

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

  • @remitheguik1303
    @remitheguik1303 2 года назад +1

    Thx ;)

  • @Naj0112
    @Naj0112 2 года назад +1

    How to do login for multi user?

    • @CodingwithElias
      @CodingwithElias  2 года назад +1

      Checkout may video on this channel called "Multi User Role Based Login System Using Bootstrap 5, PHP & MySQL
      "

  • @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

  • @barataapsii2466
    @barataapsii2466 2 года назад +1

    thank you

  • @dandanoh2000
    @dandanoh2000 3 года назад +1

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

    • @sacura_cereza
      @sacura_cereza 3 года назад

      Yeah I got this error too while trying an SQL injection. Did you find out why it shows up?

  • @sudoalex
    @sudoalex 4 года назад +16

    I love your job 3000

  • @Savespong3bob
    @Savespong3bob Год назад

    I got this output, what does it mean? I follow everystep from ur tutorial ------->Fatal error: Uncaught Error: Call to undefined function mysql_num_rows() in C:\xampp\htdocs\MIS\login.php:33 Stack trace: #0 {main} thrown in C:\xampp\htdocs\MIS\login.php on line 33

  • @malekbellaaj4756
    @malekbellaaj4756 5 месяцев назад

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

  • @atheist6430
    @atheist6430 Год назад +1

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

    • @tkdyt0674
      @tkdyt0674 Год назад

      are you from new zealand? I have internal assessments here

  • @noelnyamunokora4676
    @noelnyamunokora4676 Год назад +1

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

  • @ustudio8560
    @ustudio8560 Год назад

    Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\php programm\db_conn.php:9 Stack trace: #0 C:\xampp\htdocs\php programm\db_conn.php(9): mysqli_connect('localhost', 'root', Object(SensitiveParameterValue), 'test_db') #1 C:\xampp\htdocs\php programm\login.php(3): include('C:\\xampp\\htdocs...') #2 {main} thrown in C:\xampp\htdocs\php programm\db_conn.php on line 9. how to fix this error😪

  • @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

  • @hiramalik3814
    @hiramalik3814 2 года назад

    Please help help!!! 🥺1 problem ho Rahi ha code may wahan say run nhi kr raha anybody ????

  • @casaljayreydentorl.7066
    @casaljayreydentorl.7066 3 года назад +1

    thank you sir

  • @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.

  • @tawoplays4722
    @tawoplays4722 Год назад

    I hope you will see this comment
    I just wanna ask if that validation() function can be used in vs code?
    Cause i tried it right now and it seems like it doesnt work and i don't know what to do anymore
    And i can't call my varibale from the html file to the php file using the isset($_POST['(variable name'])
    Please help

  • @dejavu7252
    @dejavu7252 3 года назад +1

    Sir Can i ask where can you find the Test_db.sql in folders?

  • @khadijatibrahim9660
    @khadijatibrahim9660 Год назад

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

  • @hannamulunhe4117
    @hannamulunhe4117 14 дней назад

    it is not understandable for beginners because it is not verbal and also all steps from start to Ende is not Clare stapes are not seen so that we can search other material to understand this material please insert detail stapes for other material tank you

  • @franckkamga2399
    @franckkamga2399 2 года назад +1

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

  • @AnimePulse-Xx
    @AnimePulse-Xx Месяц назад

    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?

  • @rethabilemmokwa3363
    @rethabilemmokwa3363 3 года назад +1

    how do you add security level for example admin and user
    hey by the way and thank you

  • @christalyndianeramos9037
    @christalyndianeramos9037 Год назад +1

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

  • @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.

  • @_etg
    @_etg 3 года назад +1

    thanks now i can finally make login

  • @tonik6781
    @tonik6781 3 года назад +1

    i guess i am the only one whose code doesn't work

    • @CodingwithElias
      @CodingwithElias  3 года назад +2

      this happen all the time , just check your code it very carefully

  • @katherinemekwunye5399
    @katherinemekwunye5399 2 года назад

    In the part on 16:54/24:05 where you wrote if (mysqli_num_rows($result))
    And you echo hello
    Mine did note show hello it was blank

  • @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  9 месяцев назад

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

  • @RayanAlhomdi
    @RayanAlhomdi 2 года назад

    I hope make addition on this video like Two Factor Authentication by sending massage on you

  • @BoukharoubaKhaled
    @BoukharoubaKhaled 3 года назад +1

    thank you so much Bro

  • @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"

  • @nurishqashrina8397
    @nurishqashrina8397 Год назад

    Does everyone has any problem like mine which the url web is not working. It says error here like not found however how many times itried

  • @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

  • @yahya1663
    @yahya1663 2 года назад

    What did you do in the minute Is it an acronym?18:24