`
<?php $fio = $_POST['name']; $phone = $_POST['phone']; $fio = htmlspecialchars($fio); $phone = htmlspecialchars($phone); $fio = urldecode($fio); $phone = urldecode($phone); $fio = trim($fio); $phone = trim($phone); $VISIT_TYPES = [ 'standard' => 2000, 'consultation' => 5000 ]; $requested_visit_type = $_POST['visit_type']; if(in_array($requested_visit_type, array_keys($VISIT_TYPES), true)) { header('Location: https://money.yandex.ru/to/410015106353027/' + $VISIT_TYPES[$requested_visit_type]); mail("e-prohorov-2000@yandex.ru", "Заявка с сайта", "Имя: ".$fio.".\n Телефон: ".$phone.".\n Заплатил:" .$VISIT_TYPES[$requested_visit_type] , "From: e-prohorov-2000@yandex.ru \r\n"); } else { echo 'Неподдерживаемый вариант посещения!'; } ?> <html> <form action="mail.php" method="post" id="backmail" style="max-width: 420px; margin:0 auto;"> <p class="text">Выберите вариант посещения:</p> <label> <input class="radio" type="radio" name="visit_type" value="standard"> <span class="radio-custom rtext"></span> <span class="label rtext"><b>2000 руб.</b> - стандартное посещение курса</span> </label> <label> <input class="radio" type="radio" name="visit_type" value="consultation"> <span class="radio-custom"></span> <span class="label rtext" style="position: relative;top: 12px;"><b>5000 руб.</b> - посещение курса + 1 час <br>личной консультации спикера</span> </label> <div class="input"> <input type="text" name="name" id="name" placeholder="Ваше имя*" required><br> <input type="text" name="phone" id="phone" placeholder="Ваш телефон*" required> <button type="submit" class="sendmail">Записаться</button> </div> </form> </html> `