Form with Bootstrap does not pass POST [closed]

0

I'm making a login form, it was working fine, but then I decided to incorporate some elements of Bootstrap to make it visually more enjoyable. After that, my form stopped sending the POST method. Someone who can help me?

  <div class="col-lg-6" id="page-wrapper">
    <div class="panel panel-primary" Style="width: 400px; margin-left: auto; margin-right: auto;">
        <div class="panel-heading">
             <h3 class="panel-title">Entre com seu usuario e senha</h3>

        </div>
        <div class="panel-body">
            <div class="form-group">
                <form action="index.php" method="post" target="_self" id="login">
                    <div class="form-group input-group"> <span class="input-group-addon">
    <i class="fa fa-user"></i></span> 
                        <input name="user" type="text" autofocus required="required" form="login" size="50" class="form-control" placeholder="Usuario">
                    </div>
                    <div class="form-group input-group"> <span class="input-group-addon">
    <i class="fa fa-key"></i></span> 
                        <input name="senha" type="password" required="required" form="login" size="25" class="form-control" placeholder="Digite sua senha">
                    </div>
                    <p>
                        <?php if (!empty($_GET[ 'falhalogin'])) { echo "<p>Usuário (".$_POST[ 'user']. ") ou senha (".$_POST[ 'senha']. ") inválido.</p>"; } ?></p>
                    <p>
                        <input type="submit" id="entrar" form="login" value="Login" action="index.php" class="btn btn-default">
                </form>
                </p>
            </div>
        </div>
    </div>
</div>
    
asked by anonymous 01.06.2015 / 02:49

2 answers

1

I found the personal problem! When I resolved to move the file I ended up bumping into my PHP, I deleted part of the query to the database ... it gave error and redirected to the same page, but the POST of the form was lost !. I just thought the error was in the form .... Thanks!

    
01.06.2015 / 06:04
0

I do not think it has anything to do with Bootstrap. The problem must be why you're putting one paragraph inside the other:

<p>                    
<?php    
     if (!empty($_GET['falhalogin'])) { 
              echo "<p>Usuário (".$_POST['user'].") ou senha (".$_POST['senha'].") inválido.</p>";
                }
                ?>

                </p>

Take one of the <p> </p> (or that is in PHP or what is in HTML) that should work.

And one of your paragraph locks is out of </form> , turn it in:

<p>

                        <input   type="submit" id="entrar" form="login" value="Login" action="index.php" class="btn btn-default">
                </form>
                </p>
    
01.06.2015 / 05:03