0
  <body>
        <?php
        $titulo = $_POST['titulo2'];
        $cap = $_POST['capitulo2'];
        $opt = $_POST['opcoes'];
        $conexao = mysqli_connect("localhost","root","","report");
        $sql2 = "insert into avise values(null,'".$titulo."','".$cap."','".$opt."')";
        if(mysqli_query($conexao, $sql2)) {
            $msg = "Enviado! Obrigado pelo feedback.";
        } else {
            $msg = "Erro ao enviar!";
        }
        mysqli_close($conexao);
        ?>
        <script> alert('<?php echo $msg;?>');
            location.href="index.php";
            </script>
    </body>Hello! I recently stopped by and they helped me to send notices by email. Now I’m wanting to send these notices to the database. But he’s not registering.
body {
    margin: 0;
    font-family: "Tahoma";
}
.reporte {
    background-color: #ffffff;
    width: 400px;
    text-align: center;
    border-radius: 10px;
    position: fixed;
    z-index: 10001;
    top: 50%;
    left: 50%;
    margin-left: -230px;
    margin-top: -150px;
    display: none;
}
.campo h2 {
    display: inline-block;
    color: #a42f2f;
}
.campo p {
    margin-top: 0;
    color: #127d2b;
    display: none;
}
select, input {
    margin-bottom: 10px;
    outline: 0;
}
label {
    font-size: 14px;
    color: #888888;
}
select, input {
    border: none;
    background-color: #e2e2e2;
    padding: 5px 10px;
    border-radius: 5px;
}
select {
    color: #888888;
}
#btn {
    background-color: #ffffff;
    border: 2px solid #a42f2f;
    color: #a42f2f;
    padding: 6px 15px;
    cursor: pointer;
    margin-bottom: 10px;
}
#btn:hover {
    background-color: #a42f2f;
    color: #ffffff;
}
#opacidade {
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    position: fixed;
    z-index: 10000;
    display: none;
}
.teste a {
background-color: #ffffff;
border: 1px solid #a42f2f;;
color: #a42f2f;
}<body>
<div class="teste">
  <a href="#">Enviar</a>
</div>
    <div class="reporte">
        <div class="campo">
            <h2>Informe o Erro</h2>
            <p class="feedback">Enviado! Obrigado pelo feedback.</p>
            <form action="gravar-aviso.php" method="post">
                <label for="titulo2">Digite o título:</label></br>
                <input type="text" name="titulo2" id="titulo2" placeholder="Naruto..." required></br>
                <label for="capitulo2">Digite o número:</label></br>
                <input type="text" name="capitulo2" id="capitulo2" placeholder="01..." required></br>
                <input type="submit" value="Enviar" id="btn">
            </form>
        </div>
    </div>
    <div id="opacidade"></div>
</body><!-- begin snippet: js hide: false console: true babel: false -->
Then Francisco the name of the bank is report with the table warn. The friend below helped but it was mt drawn up. I wanted to use my method only find the error. I am trying to send but not register.
– OliverDamon
Does not return error and does not send data only gives the message I put on Else $msg = "Error while writing!";
– OliverDamon
In the database I created this: create database report; use report; create table warn( Cod int Primary key auto_increment, varchar(50), varchar(50), error Enum('No pages', 'Repeated Chapter', 'Shuffled Pages', 'Missing Page', 'Repeated Pages') );
– OliverDamon
Returned this error: http://prntscr.com/fuzef5
– OliverDamon
You changed the name of the connection variable?
– Francisco
N. $con = mysqli_connect("localhost","root"","");
– OliverDamon
Changed, in the example of the question you used the name
$conexaoand now it’s$con, so do:$msg = mysqli_error($con);– Francisco
Ahh yes. I switched... did agr here, showed no error. Only a blank page.
– OliverDamon
Before I had my alert saying only Error when sending. Agr when you asked to do this command, it is on a blank screen. And no longer appears nd.
– OliverDamon