Tutorial:
http://www.phpeasystep.com/workshopview.php?id=6
1. Create your database. It can be created by yourself or through the register.php.
2. Post the login html.
================
form name="form1" method="post" action="checklogin.php"
================
actually calls the checklogin.php when the user click the submit button.
3. create the checklogin.php, which is the main php access to the database the check username and password.
4. Create the login_success.php, which leads to the page if the login is right.
The most important part of the success.php is
================
session_start();
================
It creates a session for php to process. The session is different than regular cookies. Cookies are saved on users computer, which other user might access and change the login session. A php session, on the other hand, saves the data on the server, much safer to the users.
5. Create the logout.php, which destroys the session.
No comments:
Post a Comment