The very aim of a session is to create protected pages. A simple PHP script file is listed below that will protect' an image from public access. The PHP script file protectediamge.php calls require_oncetstatus.php') at the very begirming. This executes the status script once. The status script finds out the validity of the session, permits further movement if the session is valid and calls exit otherwise. The code for the protected image is shown below:

Name:  Creating protected pages.jpg
Views: 15
Size:  25.2 KB

The protected image that is displayed after proper login is shown in Figure 6, while the same page loaded without a valid session is shown in. Look at tl}"e URL on the address bar of !he browser in both th8'"figures-the same URL displays the image when the session is available and denies access when the session is not available.