I have a mutiple select html order form that a user can use to order paintings. I then verify that we have some contact information provided to us. I then want to email the order form to the company so they can process the order. I am having a problem in sending the complete order. For example if a user clicks mulitple pictures the only picture emailed is the last one selected. I am receiving the proper feedback with the print_r check and am receiving the proper echo feed back when I echo $tmp_painting. I just can't seem to get the email to work.
Any help would be greatly appreciated.
<?php
print_r ($_POST);
$painting = $_POST['painting'];
for ($i=0; $i < count($painting);$i++)
if ((!$realname ) or (!$telephone) && (!$email)) {
echo "<p class=MsoNormal align=center style='text-align:center'>Please Enter a Contact Name and either a Telephone Number or an
Email address for Contact purposes.
Thank You.</p>";
echo "<p class=MsoNormal align=center style='text-align:center'>";
echo "Please use the 'Back' button to continue.";
echo "<br>";
echo "<p class=MsoNormal align=center style='text-align:center'><a href='form.html'>Back</a></p>";
exit;
}
foreach($painting as $tmp_painting) {
$message="Name: $realname\n\n"."Company: $company\n\n"."Address:\n$address\n\n"."Telephone: $telephone\n\n"."Fax: $fax\n\n"."Email: $email\n\n".
"Painting: $tmp_painting";
}
mail("info@somedomain.com","$subject","$message","From:Form.$email\r\nReply-to:$email");
foreach($painting as $tmp_painting) {
echo "<p class=MsoNormal align=center style='text-align:center'>$tmp_painting <br></p>";
}
echo "<p class=MsoNormal align=center style='text-align:center'>Thank you for completing our contact form. Your details have been forwarded and we will be in contact within 2 working days.</p>";
echo "<br>";
echo "<p class=MsoNormal align=center style='text-align:center'>Please use the 'Home' button to go back to the Home Page.</p>";
echo "<br>";
echo "<p class=MsoNormal align=center style='text-align:center'><a href='Index.php'>Home</p></a>";
?>