1
I’m making a login form, it was working perfectly, 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>
Stopped working means what? does not arrive at index.php?
– rray
That one
$_GET['falhalogin']
come from where? seems to be the problem, at least in your form has nothing to get.– rray
I found the problem here... when I was "embedding" the template I got from bootstrap I ended up deleting part of my PHP... then the page was making a redirect to itself.. in this process I lost the POST.... I corrected and the form returned to rotate round!!! thanks guys!
– Guilherme HD