Kod html wygląda następująco:
<form action="mail.php" method="post"> <input type="text" name="email" value="Adres email /> <label class="label_check" for="sample-check"> <input name="cel" id="sample-check" value="Checkbox nr 1" type="checkbox" /> Checkbox nr 1 </label> <label class="label_check" for="sample-check1"> <input name="cel" id="sample-check1" value="Checkbox nr 2" type="checkbox" /> Checkbox nr 4 </label> <label class="label_check" for="sample-check2"> <input name="cel" id="sample-check2" value="Checkbox nr 3" type="checkbox" /> Checkbox nr 4 </label> <label class="label_check" for="sample-check3"> <input name="cel" id="sample-check3" value="Checkbox nr 4" type="checkbox" /> Checkbox nr 4 </label> </form>
Natomiast kod php:
<?php $email=$_POST['email']; $cel=$_POST['cel']; $wiadomosc=(" Adres e-mail: $email Cel treningu: $cel "); $send = mail("adres@mail.com", "Tytuł wiadomości", "$wiadomosc", "Content-type: text/plain; charset=utf-8\n" ."Content-Transfer-Encoding: 8bit\n" ."From: $email <$email>\n" ."X-Mailer: my_own/"); // jeżeli wysłano if($send) include("sent.php"); else ?>
Chodzi ogólnie o to, że chciałbym, jeżeli osoba kliknie kilka opcji checkbox aby w mailu zostały przesłane wszystkie wybrane przez niego opcje.
Będę wdzięczny za pomoc.