+ Post New Thread
Results 1 to 3 of 3
Web Development Thread, Multiple Selections Checkboxes Forwarding to an Email in Coding and Web Development; Similar to what the post here I am trying to have a form submit to a PHP page which then ...
  1. #1

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,817
    Thank Post
    272
    Thanked 1,138 Times in 1,034 Posts
    Rep Power
    350

    Multiple Selections Checkboxes Forwarding to an Email

    Similar to what the post here

    I am trying to have a form submit to a PHP page which then forwards the request using PHP mailer.
    This is what i have for the the form checkbox selection in the form

    HTML Code:
    RAM<input type="checkbox" name="periods[]" value="ram"/>P1<input type="checkbox" name="periods[]" value="p1"/>P2<input type="checkbox" name="periods[]" value="p2"/>P3<input type="checkbox" name="periods[]" value="p3"/>P4<input type="checkbox" name="periods[]" value="P4"/>RPM<input type="checkbox" name="periods[]" value="rpm"/>P5<input type="checkbox" name="periods[]" value="P5"/>P6<input type="checkbox" name="periods[]" value="P6"/>
    Then in the PHP script I Have
    PHP Code:
    $periods $_REQUEST['periods']; 
    But all that gets submitted through the email is Array?

    What have i done wrong?

  2. #2

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,412
    Thank Post
    642
    Thanked 963 Times in 663 Posts
    Blog Entries
    2
    Rep Power
    326
    You'll need to loop through the array, and append the values to your email content.

    Code:
    foreach($_POST['periods'] as $period){
        $email .= "* $period\n";
    }
    Will result in (for example):

    Code:
    * RAM
    * P2
    * P6

  3. #3

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,817
    Thank Post
    272
    Thanked 1,138 Times in 1,034 Posts
    Rep Power
    350
    I knew it was going to be something easy!

    Thanks

SHARE:
+ Post New Thread

Similar Threads

  1. Multiple email accounts with OWA
    By AnnDroyd in forum Windows Server 2000/2003
    Replies: 15
    Last Post: 14th October 2010, 09:38 AM
  2. [PHP] Checkboxes
    By Devontechie in forum Web Development
    Replies: 1
    Last Post: 4th January 2010, 11:57 AM
  3. Email forwarding
    By Pashers in forum How do you do....it?
    Replies: 2
    Last Post: 20th May 2009, 03:06 PM
  4. Open Office Calc - Drop Down Selections
    By My220x in forum Educational Software
    Replies: 3
    Last Post: 8th March 2008, 08:19 AM
  5. Multiple Email Accounts Outlook 2003
    By richard in forum How do you do....it?
    Replies: 3
    Last Post: 8th June 2007, 10:04 AM

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
  •