Reply to Re: array carrying from one php page to another

Your name:

Reply:


Posted by "Sandy Keathley" on 12/08/05 18:46

> 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??

One way:
$serArray = serialize($array);

<input type=hidden name=serArray value="<?php echo $serArray ?>">

At other end:

$array = unserialize($_POST['serArray']);

======================================

OR

session_start();
..
..
..
$_SESSION['array'] = serialize($array);


At other end:

$array = unserialize($_SESSION['array']);

If you change or repopulate the array, use the same session name, or, to be
safe,

$_SESSION['array'] = null;

before repopulating the session.

Make sure session_start() is on every page that needs access to the session
variable, including the popup.


SK



************************************************************
WebDesigns Internet Consulting
E-commerce Solutions
Application Development

Sandy Keathley
Zend Certified Engineer
sandy@KeathleyWebs.com
972-569-8464

http://www.KeathleyWebs.com/
************************************************************

[Back to original 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

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