www.webdeveloper.com
Results 1 to 3 of 3

Thread: multiple select problem

  1. #1
    Join Date
    Dec 2009
    Location
    City of Smiles
    Posts
    172

    multiple select problem

    Hi guys,

    I need help.

    I have this <select multiple="multiple> on my form containing emails fetch form database. I have a problem of getting a workaround on how I can insert the chosen email from that to the $to of mail(). I do know that $to can contain multiple recipients by placing code like this:

    PHP Code:
    $to "email1@mail.com, email2@mail.com, email3@mail.com";
    .
    .
    .
    mail($to$subject$body$header); 
    Any insights guys?

    Thanks,
    Jen
    Can't stand long hours coding in front of computer without being intoxicated.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,145
    Assuming you have given the select element an array-style name (e.g.: name="email[]"), you should then have an array of values that you can implode():
    PHP Code:
    $email implode(","$_POST['email']); 
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Dec 2009
    Location
    City of Smiles
    Posts
    172
    Thanks NogDog, it works like a charm
    Can't stand long hours coding in front of computer without being intoxicated.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles