V
V
Vadim Yagofarov2019-03-19 10:29:06
Typesetting
Vadim Yagofarov, 2019-03-19 10:29:06

The data from the form does not come to the quiz block?

The data from the form does not come to the quiz block. I didn't see any syntactic errors. Could you tell me what could be the problem and what is the best way to look for an error in such cases? The code editor does not see the error

<form class="main__form form-horizontal contactForm form ajax-contact-form" action="quiz.php" method="post" role="form">
                        <div class="quiz__slider">
                            <div class="quiz__slider_item quiz__slider_item1">
                                <div class="question__slider_item-vopros">Какая площадка больше подходит для вашего выпускного:</div>
                                <div class="question__slider_item-variable">
                                    <div class="question__slider_item-variable-item text-center">
                                        <input type="radio" id="quest1" name="r1"> <label for="quest1">открытая площадка</label>
                                    </div>
                                    <div class="question__slider_item-variable-item text-center">
                                        <input type="radio" id="quest2" name="r2"> <label for="quest2">закрытая площадка</label>
                                    </div>
                                </div>
                            </div>
                            <div class="quiz__slider_item quiz__slider_item2">
                                <div class="question__slider_item-vopros">Количество человек:</div>
                                <div class="question__slider_item-variable">
                                    <div class="question__slider_item-variable-item text-center">
                                        <input type="radio" id="quest3" name="r3"> <label for="quest3">15-20</label>
                                    </div>
                                    <div class="question__slider_item-variable-item text-center">
                                        <input type="radio" id="quest4" name="r4"> <label for="quest4">20-25</label>
                                    </div>
                                    <div class="question__slider_item-variable-item text-center">
                                        <input type="radio" id="quest5" name="r5"> <label for="quest5">25-35</label>
                                    </div>
                                </div>
                            </div>
                            <div class="quiz__slider_item quiz__slider_item3">
                                <div class="question__slider_item-vopros">Выбираем дополнительно:</div>
                                <div class="question__slider_item-variable question__slider_item-variable2">
                                    <div class="question__slider_item-variable-item pr-lg-5">
                                        <div><input type="checkbox" id="quest6" name="r6"> <label for="quest6">фото</label></div>
                                        <div><input type="checkbox" id="quest7" name="r7"> <label for="quest7">видео</label></div>
                                        <div><input type="checkbox" id="quest8" name="r8"> <label for="quest8">запуск шаров</label></div>
                                    </div>
                                    <div class="question__slider_item-variable-item">
                                        <div><input type="checkbox" id="quest9" name="r9"> <label for="quest9">питание</label></div>
                                        <div><input type="checkbox" id="quest10" name="r10"> <label for="quest10">сувенирная продукция</label></div>
                                    </div>
                                </div>
                            </div>
                            <div class="quiz__slider_item quiz__slider_item4 text-center">
                                <div class="question__slider_item-vopros">Заполните контактные данные</div>
                                <input type="name" placeholder="Ваше имя" style="height: 50px;" name="name">
                                <input type="tel" placeholder="Ваш телефон" style="height: 50px;" name="phone">
                                <button class="btn">Отправить</button>
                            </div>
                        </div>
                    </form>

<?php
if (isset($_POST['name'])) {$name = $_POST['name']; if ($name == '') {unset($name);}}
if (isset($_POST['phone '])) {$phone = $_POST['phone ']; if ($phone == '') {unset($phone);}}


if (isset($_POST['r1'])) {$r1 = $_POST['r1']; if ($r1 == '') {unset($r1);}}
if (isset($_POST['r2'])) {$r2 = $_POST['r2']; if ($r2 == '') {unset($r2);}}
if (isset($_POST['r3'])) {$r3 = $_POST['r3']; if ($r3 == '') {unset($r3);}}
if (isset($_POST['r4'])) {$r4 = $_POST['r4']; if ($r4 == '') {unset($r4);}}
if (isset($_POST['r5'])) {$r5 = $_POST['r5']; if ($r5 == '') {unset($r5);}}
if (isset($_POST['r6'])) {$r6 = $_POST['r6']; if ($r6 == '') {unset($r6);}}
if (isset($_POST['r7'])) {$r7 = $_POST['r7']; if ($r7 == '') {unset($r7);}}
if (isset($_POST['r8'])) {$r8 = $_POST['r8']; if ($r8 == '') {unset($r8);}}
if (isset($_POST['r9'])) {$r9 = $_POST['r9']; if ($r9 == '') {unset($r9);}}
if (isset($_POST['r10'])) {$r10 = $_POST['r10']; if ($r10 == '') {unset($r10);}}

if (isset($name) && isset($phone)){
if ($_POST['form']) {$formType = $_POST['form'];}
$address = "[email protected]";
$message = 
"Имя: $name 
\nТелефонный номер: $phone
\n Какая площадка больше подходит для вашего выпускного: $r1 $r2 
\n Количество человек: $r3 $r4 $r5 
\n Выбираем дополнительно: $r6 $r7 $r8 $r9 $r10


\n\nСообщение с сайта fort-boyard56.ru";
$send = mail($address,"Заполнена контактная форма на сайте fort-boyard56.ru",$message,"Content-type:text/plain; charset = UTF-8"); // \r\n

 }

fort-boyard56.ru
5c909931a95a2170806601.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
2
2cha.headz, 2019-03-19
@GIRUPC

look, this is the data being sent:
because you have a slider, then the slides are duplicated, and with them the fields, if the last fields are empty, then they come empty despite the fact that there are the same fields filled (with the exception of arrays)
plus the data you send here fort- boyard56.ru/contactform.php
and not in the quiz.php file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question