I am trying to get an external DB to populate the checkbox area on a form and then whatever the user clicks on that will come through an e-mail?? The bottom code is how I am bringing in the external file and populating the checkboxes but when I send the e-mail I only get one name. The bottom name to return. Not the whole list. The entire external DB populates in the checkboxes just fine. I thought I could grab $line and post the out come but something isn't right.
Code: [Select]
$line = (isset($_POST['names'])) ? "$line: Yes" : "$line: No";
Code: [Select]
<td>
<?php
$file = 'people.txt';
$lines = file($file);
foreach ($lines as $value => $line) {
$firstname = strtok($line, ' ');
echo "<input type='checkbox' name=\'names[]\' value=\'y\'> $line<br />\n";
}
?>
<br />
</td>



Reply With Quote

Bookmarks