Forum Moderators: open
Is it possible to send an array through post data as a "hidden" field? And if so, can anyone explain it to me? Thanks!
As mentioned, storing this information session-side may be easier, but a comma-seperated list would be fine for just a few variables. That's the way a series of checkbox values with the same name would be passed back to you anyway. And some scripting languages make it easy to array-ize that. You can use the split function in either PHP or ASP as well.
You can also have hash arrays as well. I use them for all my forms for the submit action like:
input type=image name="FormAction[AClassName::AClassFunction]" IMG SRC="/images/continue.gif"
then I just split the FormAction key to determine which class to call and what function to perform.
Its nice with regular buttons as you don't have to associate the text on the button with the action.