mail() & arrays
Posted: Wed Jun 05, 2002 3:55 pm
Working on a mail() function, and I need to be able to grab an array and insert the array items into the body of my email.
I am using a for loop right now, but I only get the last item in the array printed into the email. Any ideas?
I am using a for loop right now, but I only get the last item in the array printed into the email. Any ideas?
Code: Select all
$num_rows = count($item_name);
for($i = 0; $i < $num_rows; ++$i):
$items = "ї$item_nameї$i](*$qtyї$i])]";
endfor;
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$headers .= "From: Website<sales@website.com>\n";
$mail = "<html><body>New COD Order<br><br>
For:$full_name<br>
Email:$email<br>
Phone:$phone<br>
Address:$address<br>
City:$city<br>
State:$state<br>
Zip Code:$zip_code<br><br>
Item Name(s)$items<br><br>
Shipping:$shipping<br>
COD:$cod<br>
Total:$total
</body></html>";
$to = "me@website.com";
$subject = "COD order";
mail($to,$subject,$mail,$headers);