Serialize Array From Form


on page 1, have form allows user select 1 or more options – follows:

 

<select name="purpose[]" rows="4" multiple="multiple" >

<option value="option 1">option 1</option>

              <option value="option 2">option 2</option>

<option value="option 3">option 3</option>

<option value="option 4">option 4</option>

            </select>

 

on submit, want send array hidden form item on next page - page 2.

 

originally, tried following:

 

<input name="selection" type="hidden" value="<?php echo $_post['purpose'] ?>" />

 

to capture array, end results come out as: selection: array – no selected data.

 

so, sought out information , came across way serialize , unserialize array.

 

but, every method have tried serialize array, php fails – won’t load page.

 

so, how can take array in "purpose[]" and:

 

1) serialize on page 1,

2) unserialize in hidden form item on page 2.

 

  everything have tried has failed , @ loss.



More discussions in Dreamweaver support forum


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account