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.
Hébergement web, cloud et solutions personnalisées
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?
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
Mattlatvia25 says
I think you forgot to write the password validation
simonwellander says
HERE IS THE SOLUTION:
edit this row:
if ($norows!=0)
to
if ($numrows!=0)
instead….
SuperRorylewis says
like if have no fucking idea what he is talking about but designing a website mine is proguitartabs.co.cc
FlamingTorch9 says
This is what I get ‘Parse error: syntax error, unexpected T_ELSE in C:xampphtdocsroomlogin.php on line 25’
spaceinvader79 says
would be handy if we could get a text file with the code in, ive gone wrong somewhere with a misplaced ‘}’ =(
tiby4steaua says
On 0:01 second i can’t see the full page from you, and i can’t write like you… :(((
LetsMakeFans says
@k1llerboy1 try watching the tutorial again, works for me
k1llerboy1 says
@EverythingCanBeFree Exactly Same here
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;
DonsanUsake569 says
Why we need a, latin bitch busizz4me.info
StillCOolXP says
@JustPlayingForFun type WHERE username=’$username'”); you must use ‘$username’ 😀 hope this help !
greengale2 says
OMG~ THANK YOU! OAO
rapchikleo says
@everythingcanbefree bro username and password are case sensitive….it solved my problem check yours.
smattraensalva says
this is just annoying, oke oke oke
tmetdixt says
in 2:19 is was still show “Please enter an username and password !” is don’t show 1 what wrong with me ?
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!!
marijaaaaaakov says
@RybeckOnline try to put $username and $password in stead of $USERNAME and $PASSWORD in row 3 and 4 🙂
RybeckOnline says
@TheHumanBanana
Ther is an error on line 3 and 4……………correct it!!!
RybeckOnline says
@JustPlayingForFun
Dude this means that there is an error on line 13 of your code………..
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
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?
TJNetworkVideos says
Its giving me login error everytime… whats wrong?:( please help!
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