M
M
Max2015-10-30 19:42:59
PHP
Max, 2015-10-30 19:42:59

How to submit a checkbox in a feedback form?

Hello, I immediately say that I don’t know PHP at all.
You need to make a feedback form, where there are several checkboxes.

<?php

$recepient = "[email protected]";
$sitename = "Текст";

$name = trim($_POST["name"]);
$phone = trim($_POST["phone"]);


$pagetitle = "Новая заявка с сайта \"$sitename\"";
$message = "Имя: $name \nТелефон: $phone \n$_POST[checkbox] ";
mail($recepient, $pagetitle, $message, "Content-type: text/plain; charset=\"utf-8\"\n From: $recepient");

<input type="checkbox" class="checkbox" name="checkbox[]"  value="rassupchataia" id="">Рассыпчатая пудра<br />
                  <input type="checkbox" class="checkbox" name="checkbox[]"  value="presovanaia" id="">Прессованная пудра<br />
                  <input type="checkbox" class="checkbox" name="checkbox[]"  value="1" id="">Набор №1<br />
                  <input type="checkbox" class="checkbox" name="checkbox[]"  value="2" id="">Набор №2<br />
                  <input type="checkbox" class="checkbox" name="checkbox[]"  value="3" id="">Набор №3<br />
                  <input type="checkbox" class="checkbox" name="checkbox[]"  value="4" id="">Набор №4

The message comes, but instead of checkboxes array is written there. Help sorting through the array of checkboxes please.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question