Re: [PHP] dynamic array creation from form elements

2004-01-16 Thread Jon Bennett
nice one, solves my next problem as well if any elements are empty! Cheers, Jon jon bennett | [EMAIL PROTECTED] new media creative _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ J b e n . n e t 91 Gloucester Rd, Trowbridge, Wilts, BA14 0AD t: +44 (0) 1225 341039 w: h

Re: [PHP] dynamic array creation from form elements

2004-01-16 Thread John W. Holmes
Jon Bennett wrote: Hi, I've got a dynamically generated form and once it's submitted I need to _push the data from my form elements into an array so I can ad them to the db. My form elements are created like so: $i = 1; while ($i <= $iListItems){ ?> List Item : Why don't you just skip th

Re: [PHP] dynamic array creation from form elements

2004-01-16 Thread Jon Bennett
Hi Rich, $iListItems is set when a user chooses how many list elements they require (this is for the example pages I was asking about) and is always greater than 0 (we don't get this far in the script if it's not!). Anyway, it was my silly fault, I had changed the name of my form elements whi

Re: [PHP] dynamic array creation from form elements

2004-01-16 Thread Richard Davey
Hello Jon, Friday, January 16, 2004, 3:29:07 PM, you wrote: JB> And after the form is submitted I assumed I could do this... JB> $aListItems = array(); JB> $i = 1; JB> while ($i <= $iListItems) { JB> $tempItem = $_POST["listItem" . $i]; JB> array_push($aListItems, $tempItem); JB>

Re: [PHP] dynamic array creation from form elements

2004-01-16 Thread Jon Bennett
Hi, Sorry for the double post, meant to say 'but nothing appears to be added to the array' not the db! Thanks, Jon jon bennett | [EMAIL PROTECTED] new media creative _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ J b e n . n e t 91 Gloucester Rd, Trowbridge, Wilts,

[PHP] dynamic array creation from form elements

2004-01-16 Thread Jon Bennett
Hi, I've got a dynamically generated form and once it's submitted I need to _push the data from my form elements into an array so I can ad them to the db. My form elements are created like so: $i = 1; while ($i <= $iListItems){ ?> List Item : ++$i; ?> And after the form is submit