0
Hello guys I’m doing a test, and I have the data in a table in my index page in HTML and I intend to click a button in front of some data and then forward me to another page that will show the name of the person I clicked and insert phones in the other table that I have.
Initially I don’t know how to get the name of the person I click to use the page additel.php, someone help me. Thank you.
<table id="test" class="text-center">
<caption>Dados da Tabela Pessoa</caption>
<tr><td><h4>ID</h4></td><td><h4>Nome</h4></td><td><h4>CPF</h4></td></tr>
<?php
$selbanco = "SELECT * FROM pessoa";
$querybanc = mysql_query($selbanco);
//$conta = mysql_num_rows($querybanc); //essa funçao conta quantas linhas tem na tabela do banco
while ($linha = mysql_fetch_array($querybanc)){
$id = $linha['id'];
$nomee = $linha['nome'];
$cpff = $linha['cpf'];
//echo "$id $nomee $cpff <br>";
?>
<tr><td><?php echo "$id"; ?></td><td><?php echo "$nomee"; ?></td><td><?php echo "$cpff"; ?></td>
<td><a href="adicionatel.php" class="btn btn-success">Adicionar telefone de contato</a><?php } ?></td></tr>
</table>
You can pass on the link like this
adicionatel.php?id=<?php echo $id; ?>
ai on the pageadicionatel.php
you search the person’s data byid
.– Augusto