PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Mohammad Mostafa Shahreki   PHP MySQLi Session Handler   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example Script
Class: PHP MySQLi Session Handler
Store sessions in a database using MySQLi
Author: By
Last change:
Date: 9 years ago
Size: 506 bytes
 

Contents

Class file image Download
<?php
function AutoLoad($class) {
    require_once
'class.' . $class . '.php';
}
spl_autoload_register('AutoLoad');
$dbsh = new DBSessionHandler();
?>
<!doctype html>
<html>
<head>
<title>Database Session Handler</title>
<meta charset="utf-8" />
</head>
<body>
<?php
echo '<p>There are ' . $dbsh->onlineCount() . ' user(s) online.</p>' . PHP_EOL;
echo
'Online users: <br />' . PHP_EOL;
foreach(
$dbsh->onlineUsers() as $user) {
    echo
$user . '<br />' . PHP_EOL;
}
?>
</body>
</html>