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

Posted by: Admin  :  Category: Php

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

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.

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

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

  1. zkotz Says:

    I’m new to PHP and I’ve got a question for you: why would you do a password check by making a while-loop? Couldn’t you just make a second MySQL query like your first one:
    “SELECT * FROM users WHERE username = ‘$username'” ;

    and then add this to it:

    “SELECT * FROM users WHERE username = ‘$username’ AND password=’$password'”;

    Wouldn’t that be easier or is it unsafe or something?

  2. fatherofadsense Says:

    All in the world google adsense approval and genuine account within 2 hour and all so deals genuine earning tricks and account making contact us 03465055015

  3. Mattlatvia25 Says:

    I think you forgot to write the password validation

  4. simonwellander Says:

    HERE IS THE SOLUTION:

    edit this row:

    if ($norows!=0)

    to

    if ($numrows!=0)

    instead….

  5. SuperRorylewis Says:

    like if have no fucking idea what he is talking about but designing a website mine is proguitartabs.co.cc

  6. FlamingTorch9 Says:

    This is what I get ‘Parse error: syntax error, unexpected T_ELSE in C:xampphtdocsroomlogin.php on line 25’

  7. spaceinvader79 Says:

    would be handy if we could get a text file with the code in, ive gone wrong somewhere with a misplaced ‘}’ =(

  8. tiby4steaua Says:

    On 0:01 second i can’t see the full page from you, and i can’t write like you… :(((

  9. LetsMakeFans Says:

    @k1llerboy1 try watching the tutorial again, works for me

  10. k1llerboy1 Says:

    @EverythingCanBeFree Exactly Same here

  11. shabuna Says:

    why is it that the numrows code is not functioning???

    $query = mysql_query(“SELECT * FROM users WHERE username=’$username'”);

    $numrows = mysql_num_rows($query);

    echo $numrows;

  12. DonsanUsake569 Says:

    Why we need a, latin bitch busizz4me.info

  13. StillCOolXP Says:

    @JustPlayingForFun type WHERE username=’$username'”); you must use ‘$username’ 😀 hope this help !

  14. greengale2 Says:

    OMG~ THANK YOU! OAO

  15. rapchikleo Says:

    @everythingcanbefree bro username and password are case sensitive….it solved my problem check yours.

  16. smattraensalva Says:

    this is just annoying, oke oke oke

  17. tmetdixt Says:

    in 2:19 is was still show “Please enter an username and password !” is don’t show 1 what wrong with me ?

  18. richardbarker2 Says:

    Double checked that you haven’t got a capital letter for name of the row of the table in phpmyadmin. make sure it is consistent with your variables. I had the same problem once I spotted it , it worked perfectly!!

  19. marijaaaaaakov Says:

    @RybeckOnline try to put $username and $password in stead of $USERNAME and $PASSWORD in row 3 and 4 🙂

  20. RybeckOnline Says:

    @TheHumanBanana
    Ther is an error on line 3 and 4……………correct it!!!

  21. RybeckOnline Says:

    @JustPlayingForFun
    Dude this means that there is an error on line 13 of your code………..

  22. 1977girish Says:

    hi, how did u write localhost,root and “” “” is that commom for all xampp user? bcz i am getting a error to connect to db

  23. TheHumanBanana Says:

    Notice: Undefined index: username in C:xampphtdocslogin.php on line 3

    Notice: Undefined index: password in C:xampphtdocslogin.php on line 4
    please enter a username and password

    any help?

  24. TJNetworkVideos Says:

    Its giving me login error everytime… whats wrong?:( please help!

  25. ethanthebest Says:

    Hey dude

    I like yr vids, they are really helping but the numrows line is always coming up with a syntax error therefore the rest of the stuff related to it wont work.

    Everytime i try false correct passwords it doesnt work

Leave a Reply

*