I believe that with method get becomes easy...
each contact on that list is a link that goes to the same page only with an extension like this ( I am based on the url that appears in the image):
test.php? contact=contact name
<?php
// se existir o contato na url...
if(isset($_GET['contato'])){
$contato = $_GET['contato'];
//seleciona todos os dados daquele contato
$selecionaContato = mysql_query("SELECT * FROM contato WHERE nomeContato='$contato'");
while($dadosContato = mysql_fetch_array(selecionaContato)){
//mostre abaixo todos os dados do usuário selecionado
?>
<p>Nome Completo: <?php echo $dadosContato['nome'];?></p>
<p>telefone: <?php echo $dadosContato['tel'];?></p>
<p>Endereço: <?php echo $dadosContato['endereco'];?></p>
<?php }
// fecha o while
// se nao existir o contato na url mostra o texto abaixo..
}else{ ?>
<p>Selecione um contato no menu a esquerda</p>
<?php } // fecha o else ?>
it is quite simple this type of method, if you need a higher security, recommend the post method
If you have not created a Slug in your table advise you to check by the id of each contact.. type this...
test.php? idContact=1
$id = $_GET['idContato'];
// force para que a variavel id seja um numero para evitar hachers
$id = (int)$id;
//seleciona todos os dados daquele contato pelo id
$selecionaContato = mysql_query("SELECT * FROM contato WHERE idContato='$id'");
then the rest is the same...
Try to break your problem into smaller problems the way it gets too wide and difficult for someone to help you.
– Ricardo
You are asking for an example while you should post a question. I’m sorry but the issue of the way it is does not fit the site templates. I suggest to do a [tour] and read the guide [Ask].
– Math