Re: Another POST case?
| From: | Mike Eheler | Date: | Thu, 15 Nov 2001 18:48:15 +0000 |
| Subject: | Re: Another POST case? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-74766@lists.php.net to get a copy of this message | ||
<input type="checkbox" name="toppings[]" value="cheese" />
<input type="checkbox" name="toppings[]" value="pepperoni" />
<input type="checkbox" name="toppings[]" value="ham" />
<?
if (count($toppings) > 0 && is_array($toppings)) {
$strtoppings = implode(', ',$toppings);
$msg = "The customer wants: $strtoppings.";
}
?>
Mike
Raymond wrote:
Hi! I have this <form> using postmethod: <input type="checkbox" name="cheese"> <input type="checkbox" name="pepperoni"> <input type="checkbox" name="ham"> Then I'm trying to mail the result with the mail() function. /* recipients */ $to = someone@online.no ; /* subject */ $subject = "Order"; /* message */ $message = "$customer want to order:\n $cheese, $ham , $peppernoi" ; /* To send HTML mail, you can set the Content-type header. */ /* additional headers */ $headers = "From: Me me@online.no\r\n"; /* and now mail it */ mail($to, $subject, $message, $headers); And that works untill a customer orders only $cheese. SO.....how do i do it if I dont want any unwanted errors? Is it possible to fetch the array or something? : ) Best Regards Raymond