Log in

View Full Version : Populating an external DB into an e-mail



Shaunk
07-08-2009, 03:54 PM
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>

Jesdisciple
07-11-2009, 03:34 PM
Please post a link to the page on your site that contains the problematic script so we can check it out.

I don't see anything wrong in your code, so maybe I'll see something on your site. Since this is server-side, I might have to get that part of the application from you in a zip file and start playing with it.