Jump to content


Select Fields in Hidden Variables

  • Please log in to reply
1 reply to this topic

#1 russia5

  • Members
  • PipPipPip
  • Advanced Member
  • 94 posts

Posted 29 August 2006 - 11:46 AM

I have a multipart form.  The first page has data input including Select fields.  To my knowledge, you can not pass arrays through as Hidden Fields.  This being the case, how do you pass the Select Drop down list through as hidden variables?

#2 kenrbnsn

  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 29 August 2006 - 11:57 AM

You have to serialize the array, pass that, and unserialize it in the recieving script.

In your form:
<input type="hidden" name="somename" value='<?php echo serialize($_POST['dropdown']); ?>'>
In the processing script:
$somename = unserialize($_POST['somename'];


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users