Radio button does not save to bank

0

I'm not able to make the radio button chosen go to the bank

<form method="post" action="functions/modalQuiz.php" enctype="multipart/form-data">
                <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
                     aria-hidden="true">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title" id="exampleModalLabel">Quiz Brutus</h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>

                            <div class="modal-body">
                                <h3><?= $col2['pergunta']; ?></h3>
                                <input type="hidden" name="pergunta" value="<?= $col2['pergunta']; ?>">
                                <hr>
                                <label for="radio"><input type="radio" id="radio" name="resposta" value="<?= $col2['resposta1']; ?>"> <?= $col2['resposta1']; ?></label>
                                <hr>
                                <label for="radio2"><input type="radio" id="radio2" name="resposta" value="<?= $col2['resposta2']; ?>">  <?= $col2['resposta2']; ?></label>
                                <hr>
                                <label for="radio3"><input type="radio" id="radio3" name="resposta" value="<?= $col2['resposta3']; ?>">  <?= $col2['resposta3']; ?></label>
                            </div>
                            <div class="modal-footer">
                                <button type="submit" class="btn btn-primary" data-dismiss="modal">Salvar</button>
                                <button type="submit" class="btn btn-secondary" data-dismiss="modal">Fechar</button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>

And this is the PHP that will receive it.

include("conexao.php");

$pergunta = $_POST['pergunta'];
$resposta = $_POST['resposta'];

$insert = "INSERT INTO modalquiz(pergunta, resposta) VALUES ('$pergunta','$resposta')";
mysqli_query($conn, $insert);
//header("Location: ../index.php");
    
asked by anonymous 05.10.2018 / 22:24

0 answers