help with passing a hidden array

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
chris12295
Forum Contributor
Posts: 113
Joined: Sun Jun 09, 2002 10:28 pm
Location: USA
Contact:

help with passing a hidden array

Post by chris12295 »

I need to pass an array to my php script but i need the values to be a hidden form element. How can i do this?
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

<input type="hidden" name="array['key']" value="value" />
<input type="hidden" name="array['key2']" value="value" />
<input type="hidden" name="array['key2']" value="value" />
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

If there's a lot of values it may be easier to use sessions instead.

Mac
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

true, or maybe you could do like

<input type="hidden" name="parseme" value="value|value2|value3" />

and then do like

$finalvar = explode("|", $parseme);
Post Reply