Information registered at the bank is displayed exchanged [closed]

1

I have a form that sends the information to a bank and a page that takes this information and printa in a table format. However, the information in this table is being exchanged and when I try to register in a changed form, it appears right there, which leads me to believe that the bank is not receiving the information correctly.

Form:

<div class="container">
        <div class="row">
            <div class="col-lg-12 text-center">
                <h1 style="
                    margin-top:100px;">Cadastro de Formações</h1>
                <p> </p>
                <p class="lead"></p>
                <ul class="list-unstyled">
                    <form id="cadastro" name="cadastro" method="post" action="banco/updateF.php" style="
                        text-align: left;
                        margin-top:50px;">
                        <div class="col-lg-12">
                            <div class="form-group" style="
                        text-align: left;">
                                <label  for="NOME">Nome: </label>
                                <input  type="text" required class="form-control" id="NOME" name="NOME" placeholder="Nome da formação">
                             </div>
                        </div>

                        <div class="col-lg-12">
                            <div class="form-group" method="post" style="
                        text-align: left;">
                                <label  for="CARGA">Objetivo: </label>
                                <input  type="text" required class="form-control" id="OBJETIVO" name="CARGA" placeholder="Objetivo da formação">
                             </div>
                        </div>
                        <div class="col-lg-12">
                            <div class="form-group" method="post" style="
                        text-align: left;">
                                <label  for="OBJETIVO">Carga: </label>
                                <input  type="text" required class="form-control" id="CARGA" name="OBJETIVO" placeholder="Carga horária da formação">
                             </div>
                             <div class="form-group" method="post" style="
                        text-align: left;">
                                <label for="CONTEUDO">Conteúdo da programático: </label>
                                <textarea class="form-control" id="CONTEUDO" rows="3" name="CONTEUDO" placeholder="Conteúdo programático da formação"></textarea>
                             </div>
                             <div class="">
                                <button type="submit" class="btn btn-primary btn-lg btn-block">Salvar</button>
                            </div>
                            <div class="alert alert-info" role="alert">
                                <strong>Hey! </strong> Antes de realizar o cadastro, certifique-se de que não se esqueceu de nada! :)
                            </div>
                        </div>
                     </form>
                </ul>
            </div>
        </div> 
    </div>

Connection:

<?php
    $nome = $_POST['NOME'];
    $objetivo = $_POST['OBJETIVO'];
    $carga = $_POST['CARGA'];
    $conteudo = $_POST['CONTEUDO'];

    $strcon = mysqli_connect('localhost','root','', 'db_formacao') or die('Erro ao conectar ao banco de dados');
    $sql = "INSERT INTO formacoes VALUES ('$id', '$nome', '$objetivo', '$carga', '$conteudo')"; 
    mysqli_query($strcon,$sql) or die("Erro ao tentar cadastrar registro");
    mysqli_close($strcon);
    echo '<script type="text/javascript">
            alert("Salvo com Sucesso !");
            window.history.go(-1);
        </script>';
?>

The bank (in phpMyAdmin):

Thetable:

If you can guide me or point out the error, thank you. Any changes I update here. :)

    
asked by anonymous 15.08.2017 / 14:06

1 answer

2

Hello, check the attributes name of your inputs, I believe they are changed in CARGA and OBJETIVO .

    
15.08.2017 / 14:12