Then put a record into this table. In this tutorial, put a record with name "admin" and password "81dc9bdb52d04dc20036dbd8313ed055". This password was encrypted by md5() function from the real password "1234".
* When you test this script you must to put the real password (1234) in "password" box.
The mainly file for do 3 things.
Login form. Including 2 fields "username" and "password" and submit button "Login".
Login authorize program. Do authorize check after you submit form, if passed in username and password, this page will re-direct to main.php. If not, show the invalid user or password message.
Logout. Clear the login session when come back or refresh this page.
This file is the target file when authorize check on index.php has been passed. It checks for session variable name "username". If this variable does not exist, re-direct to index.php.
If you have PHP files must Login before open them, copy the PHP section and place it on the top of them.