Session Variable: Simple Login CheckingTag: session, variable, login Category: PHP Basicpost: 08 Mar 2008 read: 122 Session Variable Step By Step Tutorial - Part 3: From the user.form.php program at previous post, the program will check whether user's name and password is correct and registered in user.dat.php file or not. If not, the login will be denied. If it is correct, so the program will register the name and the password as variable session and the order is:
The inspection whether user have login or not is by checking whether variable session is already exist or not, you can use session_is_registered() function. Here is the example if the user who did not login then tries to access page 1 (page1.php program file).
In order to check this variable session, you have to make a program file so that it can be 'include' in every pages:
Every pages of this website has their own user category. For example, page 1 (page1.php) and page 3 (page3.php) can be accessed by all of the user then page 2 (page2.php) can only accessed by super user.
The result is:
| ||
| | Give Your Opinion | Recommend |
|

