Author Topic: Passing multi dimensional arrays in a form  (Read 10765 times)

Mike

  • Jackass In Charge
  • Posts: 11248
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Passing multi dimensional arrays in a form
« on: May 20, 2005, 12:43:41 PM »
God I wish I had known about this before.

You can pass multi dimensional arrays through html forms.

Its quite simple:
in the name field you simply add [name] after the name.  You can choose not to name the dimension which will then just add it to the end of the array.

example:
Code: [Select]



Why didn't you fuckers tell me about this before!

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Passing multi dimensional arrays in a form
« Reply #1 on: May 20, 2005, 12:58:28 PM »
Interesting... I didn't know that either, not that I've ever had a need for it.

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Passing multi dimensional arrays in a form
« Reply #2 on: May 20, 2005, 01:20:34 PM »
I'm not seeing the need for that (I don't think I've ever had to do it). What's an example?
This signature intentionally left blank.

Mike

  • Jackass In Charge
  • Posts: 11248
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Passing multi dimensional arrays in a form
« Reply #3 on: May 20, 2005, 01:30:23 PM »
Well passing a single dimensional array is useful when you have a group of checkboxes.

For an example of a multidimensional array:
I'm fiddling with making a recipe database and page interface to store recipes for my mom.

So lets look at the ingridents in a recipe:
Each ingrident will have a name, a quantity, and a unit of measure
So I can put them all in the ing array with each element being an array of the name, quant, and uom.