Passing arrays through hidden fields

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Passing arrays through hidden fields

Post by mikusan »

I have encountered the need to pass an array through hidden fields, i have tried to use the checkbox method, that is:

Code: Select all

<input type="hidden" name="uid[]" value="' . $Data['uid'] . '">
But unfortunately that does not seem to cut it... it will only pass one variable...the first.

If anyone has any suggestions please help...thx
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You either need to have one hidden field for each element in the array or you could look into something like serialize() and the unserialize().

Mac
Post Reply