Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Richard Munroe  >  Cellophane  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example of cookieArrays
Class: Cellophane
Wrapper to manipulate the values of site cookies
Author: By
Last change:
Date: 8 years ago
Size: 872 bytes
 

Contents

Class file image Download
<?php

/**
 * @copyright copyright @ 2006 by Dick Munroe, Cottage Software Works, Inc.
 * @license http://www.csworks.com/publications/ModifiedNetBSD.html
 * @version 1.0.0
 * @package dm.cookie
 * @example ./example.php
 *
 * $Author: munroe $
 * $Date: 2006/03/26 14:53:51 $
 *
 * Edit History:
 *
 *  Dick Munroe (munroe@csworks.com) 25-Mar-2006
 *      Initial Version Created.
 */

include_once('class.cookieArray.php') ;
include_once(
'SDD/class.SDD.php') ;

$theCookie = new cookieArray('test'time()+180) ;

if (!
$theCookie->exists())
{
    
$theCookie->setDataConstant(array('a' => 'one value''b' => 2)) ;
    
$theCookie->save() ;
    
header('Location: ' $_SERVER['SCRIPT_URI']) ;
}
else
{
    echo 
'$_COOKIE = ',SDD::dump($_COOKIE) ;
    echo 
'$theCookie = ',SDD::dump($theCookie) ;
    echo 
'The cookie array data = ',SDD::dump($theCookie->getData()) ;
}
?>