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
ill just message …
ill just message someone because on comments is more difficult to see
$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
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
thnks a lot Alex.
u …
thnks a lot Alex.
u really me help figure things out.
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.
Is there a source …
Is there a source code somewhre to look at ?
Excellent tutorial.
Excellent tutorial.
good tutorial. one …
good tutorial. one of the best i’ve seen. i’m new in php and is excelent. keep doing this.
this look amazing, …
this look amazing, but mine wont connect :s
you can always …
you can always watch again… this is not a live lecture
That was brilliant! …
That was brilliant! 5 STAR!!
great vid again, if …
great vid again, if anyone needs help with this is they pm me i shud be able to help
MAN DON’T RUSH WTF!
MAN DON’T RUSH WTF!
are you here …
are you here phpacademy?I have a question?
I need help will …
I need help will you help me?
That’s always nice …
That’s always nice to hear, thanks!
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
amazing tutorials.. …
amazing tutorials… please keep them up! i will for sure follow you throughout your youtube tutorial-making journey!
neeed …
neeed heeeeeeeeeeeeeeelp
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.
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?