15 responses to “Create a login function with PHP and PDO”


    Thanks for your kindness in sharing your knowledge. I would like to see more of your lectures.

  2. tablet murah

    is this login script is secure

  3. sayfudin

    i still confused sir.? please explain again ?

  4. Hugo O

    Thanks for sharing your knowledge, I have learned a lot in your website! Right now I´m trying to check the credentials however I get an error: Fatal error: Call to undefined function CheckPassword() I’ve tried a lot of things to correct this but I can’t hope you can help me in pointing me to the right direction. I´m assuming the error is whitin these lines:

    foreach( $results as $row ){
    $password_hash = $row[ ‘password’ ];
    print_r( $password_hash );
    $check = $hash_obj->CheckPassword( $password, $password_hash );

    Thanks a lot!

  5. Hugo O

    Ok, I found the problem I forgot to include this line:

    $hash_obj = new PasswordHash( 8, false );

  6. Gary

    I can’t seem to find the page you mention which goes on to talk about sessions? Really would like to find it :)


  7. Codi

    Sorry for the ‘newbie’ question perhaps, I am encountering a problem on my two lines of code which are the following:


    I am receiving the error, “Notice: Undefined index: username in …” as shown -> http://prntscr.com/6i68z5

    Is there an easy fix for this? I am unsure of how my code is the same as the tutorial provides and I am getting few errors that there clearly should not be. Hopefully there is a fix for this that you can provide. Hope to talk to you soon.

    Best regards,

  8. yuki


    Notice: Undefined variable: stored_hash in C:\wamp\www\website\login.php on line 45 (index.php)

    Any fix or thing I forgot to add to this?


  9. arjun yadav

    Oh, Yes i want to follow all your post, learn something new from your login in post. It is very helpful. Please keep it going.


Leave a Reply