I made a news system, there at index.php appears a brief summary of the news, there when the person clicks on "See more" she sees the full news. But "See more" is a 'href'. And I do not know how to handle GET method in php.
Code that is in index.php:
<div>
<?php
$noticias = listaNoticia($conexao);
foreach ($noticias as $noticia){
?>
<div class="panel panel-primary">
<div class="panel-heading"><?=date("d/m/Y",strtotime($noticia['data']))." - ".$noticia['titulo'] ?></div>
<div class="panel-body">
<?=substr($noticia['noticia'],0 , 60)?><a href="noticia-visualizada.php?id=<?=$noticia['id']?>">Ver mais...</a>
</div>
</div>
<?php
}
?>
</div>
The news is being saved in a database, through a little Panel I created. But when the person clicks on "See more", it gives "NOT FOUND". I would like to know if you have how to use the post method in this case, or what is the solution to generate the page with the news ID ...
Page code news-viewed.php:
<?php
include ("conexao.php");
$id = $_GET['id'];
$query = "select * from sistemanoticias where id = $id";
$resultado = mysqli_query($conexao,$query);
$visu = mysqli_fetch_assoc($resultado);
?>