Ciao a tutti!!!
Nonostante mi ritenessi esperta di html, sono incappata, ahimè, in un problema banale!!!
Ho un form, da inviare via email, nel quale ci sono una serie di checkbox dove scegliere delle date.. Il problema è che, quando invio il form via mail, mi prende solo il valore dell'ultima checkbox selezionata, e non di tutte. Che devo fare???
form.php
Codice PHP:
...
<tr>
<td height="18"><span class="descrText">
<input type="checkbox" name="tour" id="tour" style="margin:0px;" value="West Wine Tour - 15/04/2007" />
15/04/2007</span> </td>
<td height="18"><span class="descrText">
<input type="checkbox" name="tour" id="tour" style="margin:0px;" value="Central Wine Tour - 27/05/2007" />
27/05/2007</span> </td>
<td height="18"><span class="descrText">
<input type="checkbox" name="tour" id="tour" style="margin:0px;" value="East Wine Tour - 22/04/2007" />
22/04/2007</span> </td>
</tr>
...
invia.php
Codice PHP:
if (isset($_POST['tour']) && !$_POST['tour']=='') {
$tour = addslashes(stripslashes(trim($_POST['tour'])));
$tour = str_replace("<", "<", $tour);
}
$email_destinatario = "info@xxxxxx.it";
$oggetto = "Reservation from xxxxxxx.com";
$corpo = "Reservation from xxxxxxxx.com\n\nTitle/salutation: ".$title."\nFirst Name: ".$first_name."\nLast Name: ".$last_name."\nAddress: ".$address."\nCountry: ".$country."\nZip Code: ".$zip."\nTelephone: ".$phone."\nMobile: ".$mobile."\nEmail: ".$email."\n\nNotes:\n".$notes."\n\nTour: ".$tour."\n\n";
if (mail ($email_destinatario, $oggetto, $corpo, "From: $email")) {
echo "
Your reservation has been sent. You'll be contact as soon as possible.
Thanks for your interest.</p>
<a href=\"reservation.html\">Back to the form</a></p>";
} else {
echo "
Sorry. An error occured while sending your reservation.
Please try again!</p>
<a href=\"reservation.html\">Back to the form</a></p>";
}
nell'email che ricevo vedo solo l'ultima scelta effettuata... dove sbaglio?? grazie mille!!!