This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 1 PHP Sessions Logout feature Implementing Signin and Signout features 2 Recall We have created a login form User enters username and password Login Form passes username and password to login.php script. login.php script queries the database using the data If username and password is correct Store the employee number in the $_SESSION array at index empno Open the home page Else Open the Login Form again 3 Recall How can we verify whether the user has logged in successfully? We created a function Has_Session that checks if there is valid data in $_SESSION[empno] array NOTE: $_SESSION[empno] will contain the employee number of the employee who has logged-in. Has_Session is NOT as built-in function. We have created this function ourselves. Function is defined in functions.inc.php Include this script in all scripts that require Has_Session function. 4 Logout feature. We need to add a link in the Employee Signin Module section The link will open the logout.php script This script will destroy the current session. Logout link 5 Logout feature logout.php script The following code goes inside the logout.php script 6 Signin and Signout Features This is one of the core features of the TimeCard System Signin this means the employee should be able to enter into the system when they started work, that is when did they come to work in the morning. Signout this means the employee should be able to enter when they left for home in the afternoon....
View Full Document
- Fall '09