28 Responses to “PHP Tutorials: Register & Login: User login (Part 3)”

  1. tomcySE says:

    @mag1cwand

    i have same problem. when i write session_start(); same problem :S
    did you solved it?

  2. thejonferguson says:

    is it possible to link directly to the member.php page when you successfully login rather than having to go through a link?

  3. Andju72 says:

    i don’t get it if i create username session then i cant display registred name (not username) on members page. Please help me:)

  4. username12131415 says:

    if you wanted users to be able to register, how would you do that?

  5. skullkid12341 says:

    thank you so much =) my first login page

  6. OtherMehdi says:

    oh man, you are amazing…do you know this?

  7. frichjof90 says:

    @dashbyictfd hm nope that wasn’t my mistake… but i’ve solved it! i should’ve read all the comments before i posted this question… i had the “session_start” somewhere in the middle of the page… got it working now though!
    THX!

  8. dashbyictfd says:

    @frichjof90 put opening an closin braces and the echo welcome in the middle

  9. C0LEMAN777 says:

    “else, im gonna want to die… not that i want to die, but the page is gonna want to die”

    Win of a quote :D

    Great tutorial, working for me!

  10. frichjof90 says:

    I have a different question though…. everything works fine with me but in the member.php site or the logout.php site i get a “Warning” message blowing up because of the “session_start” function aparently. has anyone got an idea why that happens and what is wrong?! THX!

    btw Alex, you’re brilliant! THX a lot!

  11. frichjof90 says:

    @ComputerHelpz100
    i do have! i had the same and my problem was the following:
    Is your username all smal caps?! mine wasnt and if the username isn’t the same in the DB (remember it was changed to smal letters by “strtolowers”. so for e.g.

    Frichjof is my username but in the DB it would be frichjof!
    Add the “strtolower” in the login- $username and it should work! at least it did for me ;)

  12. bartjuh10 says:

    Goooo00000OOOd joB!

  13. locarish says:

    You´ve probably fixed this already. But if others may have the same question.
    An answer could be as simple as using a header.

    If every requirements are meet e.g. the ELSE field where you would normaly get the the “Succes!” or “You´re in proceed to login page”… as this tutorial ends up with.
    U´ve can simply write: header(“LOCATION:login.php”);

    Hope this helps :)

  14. locarish says:

    Dude I totally love it… You´re doin a great job and helping a lot of lost soles as myself :)
    Though I have one small inquiry…
    Since you´ve made the registration with encrypted passwords it might be convenient to make the “log in” to recognize the encrypted passwords also!!!
    I cant seem to make it work.
    Much appreciated if you either could make a tutorial that explains it, or simply a small comment would be fine as well(you might be a busy man, after all ;) )
    Would be most appriciated. TNX

  15. shianasangha says:

    Hi Alex ….. U r awsum …. the way u tel the things ,,, is amazing,.,,,,thanks a ton 4 helping meeeeeeeeeeeeeeeeeeeeeeeeeeeee

  16. Viperjts10 says:

    @ComputerHelpz100

    just check to make sure your code matches his, but most importantly, make sure you user the dollar signs ($) before your variables.

    if($username == $dbusername && $password == $dbpassword)
    {
    }

    This is the statement which compares your username and password with the ones in the database. make sure all that is correct.

  17. gamer931215 says:

    can u upload the source code ? i get a white page all the time

  18. losman06 says:

    you are a legend!!!!!

  19. ComputerHelpz100 says:

    It works almost fine but I do have one problem, when i test it it all works and when I enter the wrong password it displays Incorrect Password which is right but then when i enter the correct password it still displays Incorrect Password. has anyone got any idea what is going wrong??

  20. kawowski says:

    ironboy is ur server running?

  21. IHelpDesk says:

    @Ironboy500 same.

  22. JoWebsites says:

    Thanks a great deal Alex, love your tutorials.
    Could you please make a tutorial on how to post comments on a website? like a fb type website? Thanks again :)

  23. JoWebsites says:

    jowebsites@Ironboy500
    Hey, I just followed the entire tutorial and got it to work, I can send u my files if you want. You’ll just have to change the HOST, USERNAME and PASSWORD in the INDEX.PHP file. Send me ur email if u want and I’ll attach them in a file and send them to u. I also learning php for the first time and I am glad I got it to work Are u some kind of web designer? I do a lot of HTML and CSS but that’s about it. I’m trying to deep my toes in php and js. anyways, send me ur email :)

  24. Ironboy500 says:

    I got problem, everytime I press Log In it shows just blank page and nothing on it. I did everything like tutorial says. Any help?

  25. saadlulu says:

    this guy is great :)
    thanks for the great vids…

  26. [...] here: PHP Tutorials: Register & Login: User login (Part 3) | PHP Blog Share and [...]

  27. [...] reading here: PHP Tutorials: Register & Login: User login (Part 3) | PHP Blog Share and [...]

  28. [...] PHP Tutorials: Register & Login: User login (Part 3) | PHP Blog [...]