Hi,
I think I might have a resolution to your problem. If you are wanting to pass any amount of information from one form to the next (like a wizard or something) you might want to check out http://php.net/serialize.
serialize() returns a string containing a byte-stream representation of value that can be stored anywhere.
This is useful for storing or passing PHP values around without losing their type and structure.
To make the serialized string into a PHP value again, use unserialize(). serialize() handles all types, except the resource-type. You can even serialize() arrays that contain references to itself. References inside the array/object you are serialize()ing will also be stored.
I am cutting right from the web page (this is not my code):
/*
People usually use 'hidden' fields when they submit some
variables from previous step to the next step even if they have
so many varibles to send. It will look like following form.
*/
<form name='tmpForm' method='post' action='nextStep.php'>
<input type='hidden' name='var[name]' value='<?=$var[name]?>'>
<input type='hidden' name='var[id]' value='<?=$var[id]?>'>
<input type='hidden' name='var[address]' value='<?=$var[address]?>'>
<input type='hidden' name='var[age]' value='<?=$var[age]?>'>
<input type='hidden' name='var[gender]' value='<?=$var[gender]?>'>
<input type='hidden' name='var[car]' value='<?=$var[car]'>
.
.
.
</form>
/*
Look at the following codes. It is more simplified. I'd better use
base64_encode and serialize than stripslashes and serialize.
*/
<form name='tmpForm' method='post' action='nextStep.php'>
<input type='hidden' name='var' value='<?=base64_encode(serialize($var))?>'>
</form>
/* Have Fun !!! */
Also check out
Compression:
$var_querystring = base64_encode(serialize($some_array));
Decompression:
$some_array = unserialize(base64_decode($var_querystring ));
Here is a little script that I just created, and the output.
<?
$some_array = 'hebe mombo jumo, lakakakaka.. kekeke.. bababa.. flip, flop!';
echo "$some_array<br><br>";
$var_querystring = base64_encode(serialize($some_array));
echo "$var_querystring<br><br>";
$some_other = unserialize(base64_decode($var_querystring));
echo "$some_other<br><br>";
?>
hebe mombo jumo, lakakakaka.. kekeke.. bababa.. flip, flop!
czo1OToiaGViZSBtb21ibyBqdW1vLCBsYWtha2FrYWthLi4ga2VrZWtlLi4gYmFiYWJhLi4gZmxpcCwgZmxvcCEiOw==
hebe mombo jumo, lakakakaka.. kekeke.. bababa.. flip, flop!