Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting array information into an email 1

Status
Not open for further replies.

DaRNCaT

Technical User
Dec 18, 2002
566
NZ
I have an array of checkboxes in a form,
<input name=&quot;books[]&quot; type=&quot;checkbox&quot; value=&quot;accontbook1&quot;>
the form is passing to an email sending script on the next page. My problem is how do I get the array information into the body of the email??
I know how to do the email,
$toaddress = &quot;contact@domain.com&quot;;
$from = $firstname .$lastname;
$subjectline = $subject;
$mailcontent = &quot;Customer name: &quot;.$firstname .$lastname&quot;\n&quot;
.&quot;Customer email: &quot;.$email.&quot;\n&quot;
.&quot;Customers order: &quot;.$order.&quot;\n&quot;;
$fromaddress = &quot;webserver@domain.com&quot;;
mail($toaddress, $subjectline, $mailcontent, $fromaddress, $from);
and how to get form array information to print to a page, but not how to assign it to the content of the email.
Any help pointing me in the right direction would be much appreciated.
Thanks Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
This is a thread I posted a while ago, maybe it might set you off in the right direction

thread434-414707
 
[tt]$mailcontent .= &quot;Checkboxes: &quot; . implode($_POST['books']) . &quot;\r\n&quot;;[/tt] //Daniel
 
I didn't understand your thread likleylad- I'm not pulling stuff from a database, it's being pased by post into an email from a form.

Daniel- I put this in
$mailcontent = &quot;Customer name: &quot;.$firstname .$lastname.&quot;\n&quot;
.&quot;Customer email: &quot;.$email.&quot;\n&quot;
.&quot;Customers order: &quot;.$order.&quot;\n&quot;
.&quot;Checkboxes: &quot;. implode($_POST['books']) . &quot;\r\n&quot;;

and got this error
Warning: Wrong parameter count for implode() in /home/domain/public_html/tallpoppies/email.php on line 32

the email I got from it simply had Checkboxes:
and nothing where I'd checked the checkboxes.
have I put the code in wrong? or am I missing something here. Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
i think its a typo from danielhozac
make it
$mailcontent .= &quot;Checkboxes: &quot; . implode(&quot;,&quot;,$_POST['books']) . &quot;\r\n&quot;;

spookie
--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top