Re: array carrying from one php page to another

From: Date: Thu, 08 Dec 2005 06:59:38 +0000
Subject: Re: array carrying from one php page to another
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-227114@lists.php.net to get a copy of this message
Curt Zirzow wrote:
<?php $array = array('my', 'list', 'of', 'stuff'); $_SESSION['array_for_popup'] = $array; ?> And in the code that is called in the popup: <?php if(!isset($_SESSION['array_for_popup']) { die('you should not be here anyway, only on a popup is this allowed'); } $array = $_SESSION['array_for_popup']; // .. do your magic. // optionally clean things up. so the session var is removed. unset($_SESSION['array_for_popup']); ?>
Don't forget session_start(). :-) (You might have session.auto_start enabled, but it's not by default.) Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/

« previous php.general (#227114) next »