Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Email HTML Form Data with PHP

    Hello, I am trying to have my contactus.html file form go to my php page and send an email to me everything is working the areas that require more than one selection. I need help.

    Here is the one line of HTML code for the form:

    Code:
    <select name="opSystem[]" size="9" multiple="yes" id="opSystem">
    so then the form data is linked to my php file and this is what I have for this section of the php file

    Code:
    $body = "We have received the following information:\n\n";
    	$opSystem[] = $row['opSystem'];
    	foreach($opSystem as $o) {
    		$body .= 'Operating System(s): $o\n';
    	} //This one does not work
    	foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }	//This one works
    where the second foreach statement sends the rest of the form data. That part works. What I want it to say is:

    We have received the following information:

    Operating System(s): **List My Form Selection Data Here**

    What am I doing wrong?? I have been working all day on it. Please Help Thanks

  • #2
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fixed

    So I figured it out and fixed it myself here it is for those who looked and could not help.

    Code:
    $opSystem = array();
    	$opSystem = $_REQUEST['opSystem'];
    	
    	$body = "We have received the following information:\n\n";
    	foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
    	$body .= "Operating System(s): ";
    	foreach($opSystem as $o) {
    		$body .= "$o, ";
    	}


  •  

    Posting Permissions

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