PHP Tutorials: Register & Login: User login (Part 1)
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.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

guys,how ever i log in it says “username and password needed”, how can i fix this? im sure my code is all right
if ($you_think_his_accent_sounds_just_like_john_depp){
thumbsup();
}
yay it worked/ this guy is great/ i get anxious when i come to an impass but it worked out
Are you swedish? ^^ Latin1_swedish_ci
I love the way you teach php, this helped so much for my website. And if anyone need good HTML/Dreamweaver tuts, I found a pretty good guy, “thenewboston”
i am from KSA and i watched your videos its the best , thanks
sory , for bad English .
@thehamzan6 plus I never guessed where hes from I just asked him where hes from so watch the cheek
@thehamzan6 doesn’t sound australlian and my friends ma is with an aussie they live down under now
@YaaRiiteeeHD umm no, becuz i talked to 2 australlians and they talk EXACTLY as this guy.he is not english.
@thehamzan6 hes english :/
@allboeing dude, he’s australlian =_=
this guy has an australian accent.
where can i find the tutorial you advised us to watch in the first part of the video?
@phpacademy where you from? its very clear and my password fields missing ugh
@GrinderFX hmm do you know why my password box went missing?
@Dossageable
That is the problem when people who have no experiance rate a tutorial.
They don’t know if it is a goog or an bad tutorial!
I got that to lol!
Wait i got it lol, my stuff was set to int when i selected varchar…
0 row(s) affected.
Warning: #1048 Column ‘id’ cannot be null
Warning: #1366 Incorrect integer value: ‘chenk’ for column ‘username’ at row 1
Warning: #1366 Incorrect integer value: ‘stargate1′ for column ‘password’ at row 1
Nice Asian Beuties #lushfmlk.info#
What the hell?
2 row(s) inserted.
Warning: #1366 Incorrect integer value: ” for column ‘id’ at row 1
Warning: #1265 Data truncated for column ‘date’ at row 1
Warning: #1366 Incorrect integer value: ” for column ‘id’ at row 2
Warning: #1265 Data truncated for column ‘date’ at row 2
INSERT INTO `loginct`.`users` (
`id` ,
`username` ,
`password` ,
`date`
)
VALUES (
”, ‘alex’, ‘abc’, ”
), (
”, ‘alex’, ‘abc’, ”
);
WHy is this not working?
Only one problem though.
PEOPLE WHO FOLLOW THIS TUTORIAL:
MAKE SURE YOUR REGISTER PHP SCRIPT IS EXTERNAL!
IF ITS INTERNAL IT WILL SHOW YOUR SQL LOGIN DETAILS!
PURE EPICNES..
Please do not use the code presented here verbatim on a live site. You will be hacked, simple as that.
Please read up on the following subjects:
* User Input Validation
* SQL Injection
* PHP Session Security
This is a very basic tutorial, could be worse, not bad…but please read up on those things I mentioned before trying this out. Oh, and XHTML.
why does it say “Parse error: syntax error, unexpected T_VARIABLE in C:xampphtdocsphptestlogin.php on line 4″, i checked it and i didn’t miss anything.