cattledogz Posted March 23, 2006 Share Posted March 23, 2006 I've been working on this html form.. It is rather long...Needless to say, I want to take all the imput data and email it...I got that part working.. But I am having problems with the "multiple" options arrays.. I can get it to echo on my page, but I can't seem to figure out how to get it in the email... here's my code:[code]<? $application = $_POST["application"]; $applicationOtherComments = $_POST['applicationOtherComments']; $RequireSoftware = $_POST['RequireSoftware']; $range = $_POST["range"]; $tagtype = $HTTP_POST_VARS["tagtype"]; $readerrequirements = $HTTP_POST_VARS["readerrequirements"]; $OtherReaderRequirements = $_POST['OtherReaderRequirements']; $PurchaseTimeFrame = $_POST['PurchaseTimeFrame']; $Quantities = $_POST['Quantities']; $textfield = $_POST['textfield']; $ContactName = $_POST['ContactName']; $EMailAddress = $_POST['EMailAddress'];for ($i = 0; $i < sizeof($tagtype); $i++) { echo $tagtype[$i]; echo "<br />";}for ($i = 0; $i < sizeof($readerrequirements); $i++) { echo $readerrequirements[$i]; echo "<br />";} $when = date("D, F d H:i, Y");$info = $info . "$when\n\n";$info= $info . "Application Type: $application\n";$info = $info . "Application Comments: $applicationOtherComments\n";$info = $info . "$RequireSoftware\n";$info = $info . "Range Requirements: $range\n";$info = $info . "Tag Types: $tagtype\n";$info = $info . "Reader Requirements:\n $readerrequirements\n";$info = $info . "Other Requirements:\n $OtherReaderRequirements\n";$info = $info . "Purchase Time Frame: $PurchaseTimeFrame\n";$info = $info . "Approx. Quantities: $Quantities\n";$info = $info . "Additional Info:\n $textfield\n";$info = $info . "Submitted By: $ContactName\n";$info = $info . "$EMailAddress\n";$surveyinfo = $surveyinfo ."$info";$dinfo = $dinfo ."$info"; mail("emailaddy","RFID Survey Submission: $ContactName",$info,"From: $EMailAddress");?><? print "<TABLE BORDER=0 BGCOLOR=\"#FFFFFF\" COLUMNS=5 width=600>\n"; print "<TR>"; print "<TH><font face=tahoma size=2 align=left>Thank you $ContactName</TH>\n"; print "</table></td></tr></table>\n";?>[/code]Because $tagtype & $readerrequirements have the option of selecting multiple options... I can't get them to appear in my emails as the selections rather than just "Array" as it does now...Help:)Jen Quote Link to comment https://forums.phpfreaks.com/topic/5631-form-arrays-mail-functions/ Share on other sites More sharing options...
kenrbnsn Posted March 23, 2006 Share Posted March 23, 2006 If you're mailing this to yourself and you don't care if it isn't formatted like you have it now, the following is the easiest way:[code]<?php$info = print_r($_POST,true);mail("emailaddy",'RFID Survey Submission: ' . $_POST['ContactName'],$info,'From: ' . $_POST['EMailAddress']);?>[/code]If you care about the formatting:[code]<?php$info = ''$info .= "$when\n\n";$info .= "Application Type: $application\n";$info .= "Application Comments: $applicationOtherComments\n";$info .= "$RequireSoftware\n";$info .= "Range Requirements: $range\n";$info .= "Tag Types: $tagtype\n";$info .= "Reader Requirements:\n $readerrequirements\n";$info .= "Other Requirements:\n $OtherReaderRequirements\n";$info .= "Purchase Time Frame: $PurchaseTimeFrame\n";$info .= "Approx. Quantities: $Quantities\n";$info .= "Additional Info:\n $textfield\n";$info .= "Submitted By: $ContactName\n";$info .= "$EMailAddress\n";$info .= implode(',',$tagtype)."\n";$info .= implode(',',$readerrequirements)."\n";mail("emailaddy",'RFID Survey Submission: ' . $_POST['ContactName'],$info,'From: ' . $_POST['EMailAddress']);?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/5631-form-arrays-mail-functions/#findComment-20135 Share on other sites More sharing options...
cattledogz Posted March 24, 2006 Author Share Posted March 24, 2006 Hey... Just wanted to say thanks!! That was exactly what I needed!! Jen Quote Link to comment https://forums.phpfreaks.com/topic/5631-form-arrays-mail-functions/#findComment-20280 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.