Re: Selection lists

From: Date: Thu, 18 May 2000 08:53:51 +0000
Subject: Re: Selection lists
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-18904@lists.php.net to get a copy of this message
> If I understand you correctly, you could store an array of values within a > form like this: > > $data = urlencode(serialize($myvar)); > > then place $data in the form like > <input type="hidden" name="selectdata" value="<?php echo > $data;?>"> > > Hope this helps! I'm not sure, I don't think it's what I was looking for. I've found a way however: Perhaps there's a better/easyer way? #This code is to restore the code into the array when I want the selection list visible again: $in="dr_implementors_store0"; $i=0; while (isset($$in)) { $dr_implementors[$i]=$$in; $i++; $in="dr_implementors_store$i"; } #This code is for when I do not want the selection list visible if (isset($dr_implementors)) { sort($dr_implementors); for ($i=0;$i<SizeOf($dr_implementors);$i++) { echo "<input type=hidden name=\"dr_implementors_store$i\" value=\"$dr_implementors[$i]\">\n"; } } else { $in="dr_implementors_store0"; $i=0; while (isset($$in)) { echo "<input type=hidden name=\"dr_implementors_store$i\" value=\""; echo $$in; echo "\">\n"; $i++; $in="dr_implementors_store$i"; } } Regards, Michael

« previous php.dev (#18904) next »