Re: Passing Objects Via Session in PHP 4

From: Date: Mon, 27 Sep 2004 05:10:50 +0000
Subject: Re: Passing Objects Via Session in PHP 4
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-36417@lists.php.net to get a copy of this message
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@gmail.com 802-558-5247 For a GMail account contact me OFF-LIST

« previous php.db (#36417) next »