PDA

View Full Version : Best way of passing multiple instances of inputs between pages.


don
12-06-2002, 03:20 PM
I'm a newby so I apologize if this is simple.

I'm writing a conference registration site where users register numerous attendees one page at a time. After each is added I display existing attendees and offer an input form for another.

I'd like to put this information into a 2D array and pass it between forms somehow in a hidden text box and not use session variables.

I thought of using implode/explode somehow, but what happens if someone keys in one of the characters I'm using as a delimiter?

Am I even headed in the right direction?

Thanks in advance

don
12-06-2002, 05:29 PM
Disregard this thread.

I'm going to use "\x1F" (unit separator) as a delimeter.

Not sure if this is the best way, but it works and that's all that counts.

:)

firepages
12-06-2002, 11:58 PM
...also worth a look is serialize() and unserialize() which pack arrays into a nice string which is easy to pass around and unpack when required...


<?
$var[0]='hello';
$var[1]='world';
$var=serialize($var);

$yaks=unserialize($var);
echo $yaks[0].' '.$yaks[1];
?>