Login   Register  
PHP Classes
elePHPant
Icontem

File: sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Stanislav Shramko  >  DB_Session  >  sample.php  >  Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Just a simple test.
Class: DB_Session
Storing session data in DB.
Author: By
Last change: Little fix in a test file.
Date: 2002-08-24 13:37
Size: 633 bytes
 

Contents

Class file image Download
<?

    
include_once 'DB_Session.php';

    
// Setting the values up
    
$dsn 'mysql://root:@dragon/test';
    
$session_table 'session_table';
    
$persistent true;

    
// Creating the session
    
$sess = new DB_Session($dsn$session_table$persistent);

    
// Making anything you like with it
    
if (!isset($_SESSION['foo'])) {
        
$_SESSION['foo'] = 1;
        
session_register('foo');
    } else for (
$i 0$i 100000$i++) {
        
$_SESSION['foo']++;
    }

    
// Showing the result
    
echo "<br>\$_SESSION['foo']: " $_SESSION['foo'];

?>
<br>
<a href="sample.php">Press here</a>