Re: array carrying from one php page to another

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

 



On Thu, Dec 08, 2005 at 01:33:52AM -0500, Eternity Records Webmaster wrote:
> I have an array $journal that I want to carry from a page (where it was
> created) to another page (a popup that shows the variables contents). Is
> this automatically available? or do I have to do something special to php??

It can be sort of automatically:

<?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']);
?>

Curt.
-- 
cat .signature: No such file or directory

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux