PHP Classes

File: test_access_level.php

Recommend this page to a friend!
  Classes of Olaf Lederer  >  Access user Class  >  test_access_level.php  >  Download  
File: test_access_level.php
Role: Application script
Content type: text/plain
Description: test script for checking the access level
Class: Access user Class
Site user registration and page access restriction
Author: By
Last change:
Date: 16 years ago
Size: 1,008 bytes


Class file image Download
// this simple example will show you the access level functionality
$test_access_level = new Access_user;
$test_access_level->access_page($_SERVER['PHP_SELF'], "", 5); // change this value to test differnet access levels (default: 1 = low and 10 high)

if (isset($_GET['action']) && $_GET['action'] == "log_out") {
$test_access_level->log_out(); // the method to log off
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test page "access_user Class"</title>

<h2><?php echo "Hello ".$_SESSION['user']." !"; ?></h2>
<p>According the access level from your account it's allowed to view this page!</p>
<p><a href="<?php echo $_SERVER['PHP_SELF']; ?>?action=log_out">Click here to log out.</a></p>


For more information send a message to info at phpclasses dot org.