Re: [PHP] passing array as hidden field

2002-04-24 Thread Philip Olson
You can use implode _or_ serialize for this. $arr = array('a','b','c','d'); $vars1 = implode('|', $arr); // a|b|c|d $vars2 = serialize($arr);// try it :) And send one of the above strings through your "hidden" form element. Then upon use, either explode or unserialize it. Also consi

Re: [PHP] passing array as hidden field

2002-04-24 Thread Jason Wong
On Thursday 25 April 2002 02:09, Kevin Stone wrote: > Concept is solid, method is wrong. Understand that is but > one index in the array. To produce an array with multiple indicies you > must create a separate for each value. Example.. > > > foreach ($layer as $lay) > { > echo

Re: [PHP] passing array as hidden field

2002-04-24 Thread Richard Baskett
Personally I would serialize and unserialize, but if you just want to pass the array the way you are doing it, you need to try this instead: This will create a bunch of hidden input types with your values. Cheers! Rick In order to seek truth it is necessary once in the course of our l

Re: [PHP] passing array as hidden field

2002-04-24 Thread Kevin Stone
Concept is solid, method is wrong. Understand that is but one index in the array. To produce an array with multiple indicies you must create a separate for each value. Example.. foreach ($layer as $lay) { echo ""; } That will produce.. And when the subm

Re: [PHP] passing array as hidden field

2002-04-24 Thread Jason Wong
On Thursday 25 April 2002 02:02, Pushkar Pradhan wrote: > I want to pass a 1 dim. array through a form, I use the hidden field and > do as follows: > > foreach($layer as $lay) { >print "$lay "; > } > print "\"> > This generates the foll. source: > > > where actually it should be $layer[]