3
Hello I’m starting in html + php I’m having trouble sending the information from a text field to my php.
follows my html code.
<html>
<head>
<title>.. Telefone ..:</title>
<h1>Lista de Telefones</h1>
<h2>Informe o Telefone:</h2>
<input type="text" name="nume" onClick="document.formulario.numerotelefone.value =nume">
<form method=post name="formulario" action="executa.php">
<input type="hidden" name="numerotelefone" value=nume>
<input type="submit" value="Pesquisar">
</form>
</head>
</html>
follow my php code
<?php
$exibetelefone = $_POST['numerotelefone'];
echo "Telefone: ".$exibetelefone."<br>";
?>
I receive the text written in number instead of the number I reported in the inputtext field could help me?
Why put the attribute
value=numeand Javascriptdocument.formulario.numerotelefone.value =nume?– Laércio Lopes
Victor, to better understand your need, would you be able to explain to us why there are two inputs to the phone? In case you don’t know I suggest removing the
inputunnecessary and proceed as some of the answers below.– Caique Romero
i cleaned hygienically the code was with 2 inputs really was using Hidden because before I was using a checkbox I found that the process was the same I am reading deeper this part is I wanted to see if my idea would work before trying hehe thanks for returning
– Victor