26 thoughts on “How To Create A Login System In PHP For Beginners | Procedural MySQLi | PHP Tutorial | คู่มือการเขียนโปรแกรม ที่เว็บไซต์ Marketingtangtruong.com”

  1. I daily receive the same question from different people about having to pay $5 for the CSS file, so before asking here is my answer 🙂

    Yes you do need to be a Patreon supporter to download my lesson files INCLUDING the CSS file, and here are a few reasons why.

    1: CSS should already know CSS at this point, therefore you should not need my CSS file.

    2: This is not a CSS tutorial, and my subscribers even voted on me not including CSS in my videos because it took too long.

    3: You are not supposed to "just copy" from this video, you are supposed to "learn and apply" to your own website. Therefore you should not need my CSS.

    4: People have already supported me on Patreon to get the CSS file, therefore I won't suddenly make it free to download.

    5: Majority of my subscribers where the ones who pushed the idea of me using Patreon for my lesson files, and I have their full support in doing so.

    I keep getting comments where people want to argue with me on why they should get my lesson material for free. It is how I run my channel so deal with it 🙂

  2. Hi, I have followed all steps in this video; however, my conditional operator in signup.inc.php, which should work for signup.php, does not work. I tried diffrent ways to solve the problem, but unsuccessfully. As far as I know, extensions are not the case, conditional operator is built in function, and that is why I need your help. I would be glad to receive your response.

  3. i wrote the code, and i sign up, but for some reason it wont send to the database, there is no errors or anything, the system knows it connected to my database, but i cant view it, for some reason there no users infomation in the database, what did i do wrong?

  4. Hi Dani, this is a great tutorial. Thank you so much for this. I have a request though. Many of us are learning to apply this knowledge in our projects. You said it yourself that this was only for beginners and not secure. It may not be practical for us to actually use it commercially.
    Can you please make an advanced tutorial? One which we could rely on to use in our commercial or personal projects? Please?

    I request you to make an advanced version of this tutorial to fulfil three requirements:

    1: Make it using PHP 8
    2: Make it secure and safe to be used commercially (as much as you can)
    3: Make it by following object oriented principles instead of using procedural PHP

    All of the tutorials on Youtube are only useful for local servers and none of them are practical and useful in any meaningful way except learning as a beginner. I really hope you change that. 🙂

  5. Hey Dani, this might be a late request but would you mind making a video showing how you can add your signup information into 2 tables in the database with your method of using prepared statements. For example, one that will store only the users information (name, surname, dob phone number) in one table, and login information in the users table (email, username and password. I have been able to do that using real escape string by having 2 sql statements, but can't quite figure it out using the prepared statements! I hope you help on this one! your videos really help me a lot and inspire me bigtime! Cheers from Zimbabwe…

  6. 1:18:40 I think there is a problem with "mysqli_stmt_close($stmt)" function right here. Because "return" statements finish execution of the function and since there are "return" statements earlier, this line of code will never be executed. Also since PHP never explicitly requires to close statements, we don't get any errors or warnings about it. The solution I guess is to put "mysqli_stmt_close" right before the "if" statement.

  7. Hi Daniel, Awesome login video. although i run into an error while trying to run the prepared statement that INSERTS data into the Database, which then displays the "stmt:failed" message. What could be the cause?

  8. 1:04:24 it says I have a syntax error.

    function invalidUid($username){


    if (!preg_match("/^[a-zA-Z0-9]*$/"), $username){

    $result = true;



    $result =false;


    return $result;

    here is my code. can someone please help me because I have no idea what i have done wrong. I am using visual studio code so I don't know if that has something to do with it but my login system won't work and it keeps referring to the highlighted line as incorrect

    edit: when I comment this out then the next line of code shows the exact same error saying there is an unexpected token "," but removing commas doesnt seem to fix it either. It seems like all my functions are coming up as errors.

  9. Wow! Sounds great.
    Very very helpful video.
    Many many thanks for your awesome efforts.

    * please make a video regarding users post (image+text) and filter with php.
    100% recommending this channel.

  10. Thank you Dani. Perfect video, I was able to get a login system working for a new backend area of my website. I had some head banging moments, but as with everything in my life, it all came down to mundane things like spelling, and punctuation. I'm in the process of moving a system that was created in access to mySql and the web so I am sure I will be utilizing a bunch of your videos!

  11. Hi mate, thanks for the good tutorial everything working fine but there’s one issue. After the user is logged in he can still go to the login.php. How we can prevent that and redirect the user who is already logged in to index for example every time he try to access the login.php . I try session but is not working. Cheers once again.

  12. I got a fatal error and I know why it's happening but don't have a fix.
    Cannot redeclare invalidUid() (previously declared in D:xampphtdocsloginsystemincludesfunctions.inc.php:13) in D:xampphtdocsloginsystemincludesfunctions.inc.php on line 23


Leave a Comment