You are here: Re: [PHP] array carrying from one php page to another « PHP « IT news, forums, messages
Re: [PHP] array carrying from one php page to another

Posted by Chris Shiflett on 12/08/05 08:59

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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация