Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-22-2010, 12:49 AM   PM User | #1
pickil
New to the CF scene

 
Join Date: Mar 2010
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
pickil is an unknown quantity at this point
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
pickil is offline   Reply With Quote
Old 03-22-2010, 02:37 AM   PM User | #2
pickil
New to the CF scene

 
Join Date: Mar 2010
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
pickil is an unknown quantity at this point
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, ";
	}
pickil is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:01 AM.


Advertisement
Log in to turn off these ads.