0
I have this form
<form method="POST" action="/bolao/home/selecoes/russia/cadastrar.php">
<label>
<label>
<div align="center">Nome</div>
</label>
<div align="center">
<input type="text" name="nome" id="nome">
<br>
</div>
<label>
<div align="center">Email</div>
</label>
<div align="center">
<input type="text" name="email" id="email">
<br>
</div>
<div align="center"><br>
</div>
<div align="center">
<div align="center"><br />
<strong>Palpites Grupo A <span class="style1">PRIMEIRA</span> Rodada dias 14/06 e 15/06</strong><br />
<textarea name="palpites" id="palpites" cols="45" rows="2">RUSSIA X - X ARABIA SAUDITA
EGITO X - X URUGUAI
</textarea>
<br />
<br />
<strong>Palpites Grupo A <span class="style1">SEGUNDA</span> Rodada dias 19/06 e 20/06</strong><br />
<textarea name="palpites2" id="palpites2" cols="45" rows="2">RUSSIA X - X EGITO
URUGUAI X - X ARABIA SAUDITA
</textarea>
<br />
<br />
<strong>Palpites Grupo A <span class="style1">TERCEIRA</span> Rodada dia 25/06</strong><br />
<textarea name="palpites3" id="palpites3" cols="45" rows="2">RUSSIA X - X EGITO
ARABI SAUDITA X - X EGITO
</textarea>
<br />
<br />
</p>
<input type="submit" value="Cadastrar Palpites" id="cadastrar" name="cadastrar" />
</div>
</form>
And my registering.php
$nome = $_POST['nome'];
$email = $_POST['email'];
$palpites = $_POST['palpites'];
$palpites2 = $_POST['palpites2'];
$palpites3 = $_POST['palpites3'];
$connect = mysql_connect('localhost','root','');
$db = mysql_select_db('copa');
$query_select = "SELECT nome FROM palpites WHERE nome = '$nome'";
$select = mysql_query($query_select,$connect);
$array = mysql_fetch_array($select);
$query = "INSERT INTO palpites (nome,email,palpites,palpites2,palpites3) VALUES ('$nome','$email','$palpites','$palpites2','$palpites3')";
$insert = mysql_query($query,$connect);
?>
<script>
alert("Seus Palpites Foram Gravados Com sucesso.") ;
</script>
// volta pra lá
<?PHP
header("Refresh: 0; http://localhost/bolao/home/palpitar.php");
?>
I would like to know how to limit so that a person does not send the form with the same email.
Please put a Minimum, complete and verifiable example so that we can give a more appropriate response.
– Viktor Hugo
Was corrected my question.
– Joaquim Alberico
If I understand you want the email to be a single key (can’t have two equal), then before registering the form data you need to search the database if there is an email already registered with the amount sent in the form
– Costamilam
Exact @Guilhermecostamilam.
– Joaquim Alberico
Accepting an answer is important because it makes it clear to other users that your problem is solved, and how it was solved. At the same time, it rewards the author of the best answer for having solved his problem. Learn how to accept a reply in https://pt.meta.stackoverflow.com/questions/1078/como-e-por-que-aceitar-uma-resposta/1079#1079
– user60252