17 Password hash php mysql

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2024

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

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

    wow you didn't only give us how to hash the password, but also you give us a tutorial on how to prevent sql injection.

  • @lewiswood1630
    @lewiswood1630 4 ปีที่แล้ว +7

    If your code is correct but you still get the "LOGIN failed" message, check that the setting in the database for the password field is set to Varchar(100). Mine at Varchar(45) was too short to accept the hashed password meaning that I could never get a match as the hashed password was presumably truncated.

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

      you just saved me a huge headache a day before my project is due

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

      @@kylemarshall8545 You're welcome. Took me ages to solve it as I just kept going through my code and not finding anything wrong. Could not find anything via Google either so I added the comment. Glad it helped. Good luck with your project.

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

      Thank you sir, you are a life saver. I was dealing with this issue since 1 Week. Thank you. You deserve a subscription.

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

      You saved my life, my friend

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

      @@vidwatkanade9180 You're very welcome. Amazing what two simple lines of text in a comment can achieve.

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

    Yes, but this is meaningless unless you show how login works for a user that was already created with a hashed password.

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

    It was great but
    How should we call the hash value when the login and registration page codes are separate?

  • @Dr.UdaraSenarathne
    @Dr.UdaraSenarathne 2 ปีที่แล้ว

    Thank you very much!

  • @glenn8459
    @glenn8459 4 ปีที่แล้ว

    Does it include the username in when it is trying to hash the password to make each one unique?

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

      No. Salting a hashed password usually involves taking a date or random number and combining it. According to a note on the official PHP site, By default, it'll use /dev/urandom to create the salt, which is based on noise from device drivers. www.php.net/manual/en/function.password-hash.php

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

    Thank you very much for the content! I Subscribed !

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

    If it gives you a different value for the same input. How do you actually check it at log in time. The hashes would never match!

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

      using password_verify()

  • @thebigglitch6454
    @thebigglitch6454 4 ปีที่แล้ว

    Thanks, great video :)