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:

<?php

$i = 1;

while ($i <= $iListItems){

?>

<div class="row">
<div class="label">List Item <?php print $i ?>:</div><div class="formw"><input type="text" name="listItem<?php print $i ?>" size="40" /></div>
</div>


<?php

    ++$i;
?>
<?php } // end while ?>

And after the form is submitted I assumed I could do this...

$aListItems = array();

$i = 1;

while ($i <= $iListItems) {

        $tempItem = $_POST["listItem" . $i];
        array_push($aListItems, $tempItem);
        ++$i;
}

print_r ($aListItems);

but nothing appears to be added to the db, how can I access the $_POST vars within a loop ??

Thanks,

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: http://www.jben.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to