Login   Register  
PHP Classes
elePHPant
Icontem

File: test_case1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Guilherme Blanco  >  DcSessionManager  >  test_case1.php  >  Download  
File: test_case1.php
Role: Example script
Content type: text/plain
Description: First example of usage
Class: DcSessionManager
Manage sessions using a MySQL table to store data
Author: By
Last change: Corrected include file and constructor.
Date: 2004-05-11 07:32
Size: 633 bytes
 

Contents

Class file image Download
<?php
  
include "dcSessionManager.inc.php";

  
$linkId mysql_connect("localhost""userhere""password");
  
mysql_select_db("databasehere");

  
$name "Guilherme Blanco";

  
$sess = new dcSessionManager("default"$linkId);
  
$sess->setSaveSession(1);
  
$bReturn $sess->setSessionValue("name");

  echo 
"Values in the table:<br />";
  echo 
print_r($sess->getSessionValues());
  echo 
"<br /><br />";
  echo 
"Value of the cookie that I store in your HD:<br />";
  echo 
$_COOKIE['hash'];
  echo 
"<br /><br />";
  echo 
"<br /><br />";
  echo 
"Close and reopen this page again. Your data will be here yet!";
?>