[FX.php List] add multiple records with one submit

Derrick Fogle derrick at fogles.net
Mon Sep 22 18:00:23 MDT 2008


On Sep 22, 2008, at 6:41 PM, Tim 'Webko' Booth wrote:

> Gets more tricky of you want to add a record with more than one  
> piece of data...

I use the record key/ID to send the rest of the record's values...

   <input type="checkbox" name="selections[]" value="<?php echo $key ? 
 >">
   <input type="hidden" name="name[$key]" value="<?php echo $namedata ? 
 >">
   <input type="hidden" name="phone[$key]" value="<?php echo  
$phonedata ?>">

...

foreach($_POST['selections'] as $key => $value) {
    $value //the record ID of the record
    $_$POST['name'][$value] //should be the corresponding namedata
    $_$POST['phone'][$value] //should be the corresponding phonedata
}


Derrick



More information about the FX.php_List mailing list