PHP Tutorials: Register & Login: User login (Part 1)
October 18th, 2010
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.


how to login on the same page???
Something very important if you use cpanel on a shared host.
Username is not a simple username. You need to enter something like this
mysql_connect(”localhost”,”account_username”,”password”) or die(”Couldn’t connect”);
phpMyAdmin allows you to work with simple username but you must combine the users with the account.
if your user account is ‘dave’ and you database user name is ‘banana’
You enter ‘dave_banana’ as username.
i get a parse error
@h3nno I get the same thing, dont know what I am doing wrong
I’m speechless, simply awesome!!! thank you!!!
@OneAntagonist British accent is the best!!!
IDOL!!!!!!!!your the best!!!!i love u!!!!!^^
question….everything works, thx a lot. but now i need to transfer everything to a webhost. how do i put the php files i made from your tutorial?..do i just simple copy and paste the code to my html page?
Can u help me plx
Can’t connect with db i do it just like u and when u log in always same code please enter and username and password :x
And now only the shows de code of php
Ty
What screen recorder did you use?
@mcgyvr2009i They still use databases but they use codes to program.
@Thewebsitemaster1 Bull. The professionals who make bigtime money use nothing but codes. MySQL, PHP, HTML, CSS, JavaScript, AJAX, and a whole lot more. They don’t use phpmyadmin. Or anything else that is a database storage area. They use SQL, and MySQL to store their database. Everything is code activated. If they can do it so can everybody else.
Really excellent tutorials. Love the fact that they’re recorded with the small viewport, since I watch them on my iPhone (while eating lunch), and the text is large enough to be legible on a 3.5″ screen…
@mcgyvr2009i you can’t without phpmyadmin you need it to do the database to store them in
U’ r simply the best, better then all the rest :)))))
@OneAntagonist Thank you! :)
omgsh i love your accent (:
@mcgyvr2009i you could do it all via mysql command line
Why do i get this??:O what is wrong?
Notice: Undefined index: username in C:wamplogin.php on line 3
Notice: Undefined index: password in C:wamplogin.php on line 4
Please enter and username and a password
How can I do all of this without php-myadmin because my mother wont allow me to install it.
@Dossageable Totally!!! I love his tut’s so much :D!!!!!!!!
Hi
I have created the script, but every time I enter a username and password and click login I recieve the if else die (”Please enter a username and password”);
Any ideas why it is going straight to that? I have double check all spelling and retyped everything.
You are an excellent teacher i had ever taught. Keep doing for beginner and experts also. That is a best way to explain.
That is what i want to implement in my office.
Awesomest dude! great tutorials.
i get a download if i login!