Results 1 to 2 of 2

Thread: Populating an external DB into an e-mail

  1. #1
    Join Date
    Jul 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Populating an external DB into an e-mail

    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>

  2. #2
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    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.
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •