Originally posted by: Cheetah8799
Actually explaining how to do the code is a bit complicated, that's why you're not getting much help. If you've never done this before, I suggest you dig around the web for some documentation, or buy some PHP/MySQL books to help so that you can be sure to develop a secure solution as opposed to something simple that happens to work.
Basically, the way it works is you have the page check if the user has a session cookie set that shows they logged in. If no cookie, then ask for login info. When form is submitted, check the dbase for user/password. If good, set the session cookie. If bad, ask users to re-submit, but don't tell them if it was username or password, otherwise it makes it easier for crackers to break into your system. Also be sure to have a log-out button on your pages so they can change accounts without having to close their browser completely to get a new session.