while request i mail function
Hejsajeg har en mail function hvor en formular er sendt igennem en mail, og hvor der er nogle check boxes som alle skal listes inden for det same navn i formen.
den ser nogenlunde sådan her ud:
/* recipients */
$to = $_REQUEST['email'];
/* subject */
$subject = "site enquiry form";
/* message */
$message = '
<html>
<head>
<title>site enquiry form</title>
</head>
<body>
<p>Thank you for your enquiry at site.!</p>
<table width=\"100%\">
<tr>
<td valign=\"top\">Title & Name:</td>
<td>'.$_REQUEST['title'].'. '.$_REQUEST['first_name'].' '.$_REQUEST['last_name'].'</td>
<tr>
<tr>
<td valign=\"top\">What to do on the tour:</td>
<td>'.$_REQUEST['tours'].'<br /></td>
<tr>
<tr>
<td valign=\"top\">Safaris</td>
<td>'.$_REQUEST['safaris'].'<br /></td>
<tr>
</table>
';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: enquiry site <enquiry@site.com>\n";
/* and now mail it */
mail($to, $subject, $message, $headers);
mail('enquiry@site.com', $subject, $message, $headers);
-----------------------------------------
where the form says:
<td>'.$_REQUEST['tours'].'<br /></td>
og
<td>'.$_REQUEST['safaris'].'<br /></td>
skal disse 2 gerne gentages da selve disse er check boxes i formen som det ses her:
<STRONG>Tours</STRONG><br />
<INPUT type="checkbox" value="stone-town" name="tours"> Stone Town<br />
<INPUT type="checkbox" value="spice" name="tours"> Spice Tour<br />
<INPUT type="checkbox" value="blue" name="tours"> Safari Blue (Blue day)<br />
<INPUT type="checkbox" value="dolphin" name="tours"> Dolphin Safari<br />
<INPUT type="checkbox" value="jozani" name="tours"> Jozani Forest<br />
<INPUT type="checkbox" value="north" name="tours"> North Trip (Beach Day)<br />
<INPUT type="checkbox" value="jeep" name="tours"> Jeep Safari<br />
<INPUT type="checkbox" value="prison" name="tours"> Prison Island and Snorkeling<br />
<INPUT type="checkbox" value="Other tour suggestion" name="tours"> Other tour Suggestion
</TD>
<TD width="210" style="font-size:10px;">
<STRONG>Safaris</STRONG><br />
<INPUT type="checkbox" value="serengeti" name="safaris"> Serengeti Natl. Park<br />
<INPUT type="checkbox" value="ngorongoro" name="safaris"> Ngorongoro Crater<br />
<INPUT type="checkbox" value="lake" name="safaris"> Lake Manyara Natl. Park<br />
<INPUT type="checkbox" value="tarangire" name="safaris"> Tarangire Natl. Park<br />
<INPUT type="checkbox" value="arusha" name="safaris"> Arusha Natl. Park<br />
<INPUT type="checkbox" value="kilimanjaro" name="safaris"> Mountain Kilimanjaro<br />
<INPUT type="checkbox" value="meru" name="safaris"> Mountain Meru<br />
<INPUT type="checkbox" value="Other safaris" name="safaris"> Other safaris
hvordan gør jeg lige det?
har prøvet flere forskellige måder med en while men kan ikke få det til at virke.