Re: Passing Objects Via Session in PHP 4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



INDEX.PHP
<?php
include_once('include/global.php');

$db = &getObject('mysql');
$db->open('localhost', 'root', '');
$db->selectDb('directory');

$tpl->display('main.tpl');

$db->test = 'this is page 1';

echo '<pre>';
print_r($_SESSION);
echo '</pre>';
$db->test = 'this is page 2';
?>

PAGE2.PHP
<?php
include_once('include/global.php');

$db = &getObject('mysql');
$db->open('localhost', 'root', '');
$db->selectDb('directory');

$tpl->display('main.tpl');

echo '<pre>';
print_r($_SESSION);
echo '</pre>';

?>

PAGE1 PRINT_R RESULTS
            [mysql] => mysql Object
                (
                    [connection] => Resource id #7
                    [test] => this is page 1
                )

PAGE2 PRINT_R RESULTS
            [mysql] => mysql Object
                (
                    [connection] => Resource id #7
                    [test] => 
                )


-- 
Joseph Crawford Jr.
Codebowl Solutions
codebowl@xxxxxxxxx
802-558-5247

For a GMail account
contact me OFF-LIST

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux