Register the user in the database | PHP and MySQL secure login system | Part 1

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • Hi guys. In this tutorial we are going to create a secure login system with php and mysql.
    We are gonna have a register page, a login page, a forgot password page, and an user account page where the user is going to be redirected when he logs in successfully.
    Every input field will have a proper and secure validation, so you can easy implement the code in a live website.
    This is the first video of a three series and we are going to see how to connect to a database
    and register the user.
    To learn about prepared statements you can watch the video:
    • How to write mysql pre...
    or read the article:
    digitalfox-tut...
    You can buy me a coffee and get the whole source code in a zip file.
    The code is updated and uses the PHPMailer library to send emails.
    www.patreon.co...
    If you don't know how to configure PHPMailer watch this video:
    • Send Email from localh...
    or
    Read the article on my website.
    digitalfox-tut...

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

  • @RodolphoArrudanogoogle
    @RodolphoArrudanogoogle Месяц назад

    what a nice tutorial to watch. Thanks for making this!

  • @santosh_rawat
    @santosh_rawat 4 месяца назад

    This will help in my Final Year Project !! Thanks ❤

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

    Thank you, this tutorial was very concise and well explained.

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

    Appreciate your work!

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

    This is very valuable content, bro. Thank you.

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

    Hi, downloaded src code from ur site, setted up db and everything, registration isn't working. Says An error occurred. Please try again. Other things like resetting password, login for manually added user working correctly. DB Log is empty too

    • @DigitalFox-tutorials
      @DigitalFox-tutorials  Год назад +1

      Hey i just downloaded the files, and everything is working, registration to. As for the log file check the files permissions.
      If i think of something on what goes wrong on your side, i will get back to you.

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

      It worked for me after writing 'root' in the definition for USERNAME in config.php but I'm a complete beginner so you'll probably know more about this than me :)

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

      @@rosawolke2788 thank you so much!!!

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

    This explained well!

  • @suleymanates1127
    @suleymanates1127 4 месяца назад

    "Hello sir, I'm a junior web developer and I'm working on a project that requires a login and registration system. I'm a bit confused about a piece of code I've come across. What would happen if I use the following PHP code for registration?
    // Class definition
    class Register {
    public function register($username) {
    // Codes to handle username with session
    }
    }
    // Create object
    $register = new Register();
    // Method call
    echo $register->register($username);
    Would this kind of code structure work if it was made good or is it better to use this kind of structure.
    Thank you so much .

    • @DigitalFox-tutorials
      @DigitalFox-tutorials  4 месяца назад

      Yes, you can use OOP to create a registration system. I prefer to create code using objects, it's easier to maintain and it's easier to move your classes from a project to another.

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

    "FILTER_SANITIZE_STRING" seems to be deprecated in PHP 8.1

  • @alababbuenaventurajr.l.3378
    @alababbuenaventurajr.l.3378 Год назад

    Hey George! I follow along with your tutorial, but I am not able to login even if I input a valid credentials on it.

    • @DigitalFox-tutorials
      @DigitalFox-tutorials  Год назад

      Hey, in most cases when we typing along we make typos. Did you check for any typing errors in the login function?
      Compare your loginUser function with the one on this page digitalfox-tutorials.com/tutorial.php?title=Coding-a-secure-login-system-with-php-and-mysql

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

    Thank you, this was well explained & helpful :)

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

    "if($password != $dbpass) {" you are using loose comparisons which might be still somehow vulnerable

    • @DigitalFox-tutorials
      @DigitalFox-tutorials  Год назад +1

      Hey, where did you get this line of code? I use the password_verify function to check the password that is stored in the database.

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

    Why you dont close the php tag?

    • @DigitalFox-tutorials
      @DigitalFox-tutorials  Год назад +1

      If you have a php file and you are writing only php, you don't have to.

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

      @@DigitalFox-tutorials and it is more efficient because you are not constantly stopping and starting the interpretor