Hi!
I'm another confused new user.
Have built a form and everything is fine but I wanted to send the form results to email. I have cracked the easy bit in that the name, email address and message get sent but whenever I try to display the choices from the check boxes, 'array' is printed. The code is below.
<?php
echo "<p><font face=\"arial\">Thank you, <b>".$POST["name"]."</b>, for your message!</p>";
echo "<p>Your e-mail address is: <b>".$POST["email"]."</b>.</p>";
echo "<p>Your product choices are:<br/>";
if (!empty($POST["brochure"])) {
echo "<ul>";
foreach ($POST["brochure"] as $value) {
echo "<li>$value</li>";
}
echo "</ul>";
}
echo "<p>Your message was:<br />";
echo $_POST["message"]."</p>";
echo "</font>";
$msg = "<p><strong>Name:</strong> ".$POST["name"]."</p>";
$msg .= "<p><strong>E-Mail:</strong> ".$POST["email"]."</p>";
$msg .= "<p><strong>Message:</strong> ".$_POST["message"]."</p>";
Getting the right mail string on this line is the problem
$recipient = "seangriffin15@yahoo.co.uk";
$subject = "Form Submission Results";
$mailheaders = "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/html; charset=ISO-8859-1\r\n";
$mailheaders .= "From: My Web Site <defaultaddress@yourdomain.com> \n";
$mailheaders .= "Reply-To: ".$_POST["email"];
//send the mail
mail($recipient, $subject, $msg, $mailheaders);
?>
I've been trying different loops but nothing seems to work. 🙂 🙂 Its probably really easy so I thought someone might have a quick solution.
Thanx for your help guys!!