PHP Tutorials: Register & Login: User login (Part 2)

Part of the ‘Register & Login’ Project from PHP Academy. This tutorials walks you through how to process a username and password based login against details found in a database, set a session, and process a logout function.

Duration : 0:9:32


Technorati Tags: , , , , , , , , , , , , , , , ,

21 Responses to “PHP Tutorials: Register & Login: User login (Part 2)”

  • Juanakatyrone says:

    ill just message …
    ill just message someone because on comments is more difficult to see

  • Juanakatyrone says:

    $numrows = …
    $numrows = mysql_num_rows($query);
    if ($numrows!=0)
    {

    while ($row = mysql_fetch_assoc($query))
    {
    $dbusername = $row['username'];
    $dbpassword = $row['password'];
    }

    to be continued in next comment

  • Juanakatyrone says:

    hi. i am having a …
    hi. i am having a li trouble here. Everything in my code works except that when i type a name and a correct password, it shows me the “INCORRECT PASSWORD” message although the password is correct. if i type random stuff that is not on my database, the correct messages show up. I have been stuk on this for hours and dont know the cause of the incorrect display- if you would kindly help me… here is my code on the next comment

  • JoeNguyen119 says:

    thnks a lot Alex.
    u …

    thnks a lot Alex.
    u really me help figure things out.

  • JoeNguyen119 says:

    do the coding …
    do the coding yourself bro.
    Copy and paste is such a bad smell
    i’m sure u dun wanna be smelly?
    so try to code then u can understand wat u’ve done.

  • int07101 says:

    Is there a source …
    Is there a source code somewhre to look at ?

  • MrCrow314 says:

    Excellent tutorial.
    Excellent tutorial.

  • jccruz87 says:

    good tutorial. one …
    good tutorial. one of the best i’ve seen. i’m new in php and is excelent. keep doing this.

  • darktonight says:

    this look amazing, …
    this look amazing, but mine wont connect :s

  • nosnaj says:

    you can always …
    you can always watch again… this is not a live lecture

  • ZepplinProgramming says:

    That was brilliant! …
    That was brilliant! 5 STAR!!

  • tozzy498 says:

    great vid again, if …
    great vid again, if anyone needs help with this is they pm me i shud be able to help

  • SriLankanAirlines says:

    MAN DON’T RUSH WTF!
    MAN DON’T RUSH WTF!

  • whyiamcool says:

    are you here …
    are you here phpacademy?I have a question?

  • whyiamcool says:

    I need help will …
    I need help will you help me?

  • phpacademy says:

    That’s always nice …
    That’s always nice to hear, thanks!

  • bohakasha says:

    Your tutorial are …
    Your tutorial are so easy to follow. I have come to understand php better from your video. It was exactly what i needed.
    Thanls a lot and keep it coming, I’ve already subscribe

  • TheBatchGuy says:

    amazing tutorials.. …
    amazing tutorials… please keep them up! i will for sure follow you throughout your youtube tutorial-making journey!

  • montage12333 says:

    neeed …
    neeed heeeeeeeeeeeeeeelp

  • phpacademy says:

    The reason for the …
    The reason for the loop is that it will get every record present for each time it loops :)

    And yeah, I suppose that is a good way of doing it, I was just showing how to easily evaluate a password and if it is correct or not.

  • modernclics says:

    Very good. …
    Very good. Allthough, I think it’s much easier to check user and pass at the same time:

    SELECT * FROM users where username=’$username’ AND password = ‘$pass’

    Plus it’s more secure because you don’t let hackers now that the username exisits you just display “username and/or password doesn’t exist”

    I don’t understand the while in conjunction with mysql_fetch_assoc, doesn’t work the same without the while?

Leave a Reply