0
I made a news system, ai na index.php aparece um breve resumo da notícia, ai quando a pessoa clica em "Ver mais" ela vê a notícia completa. But "See more" is a 'href'. And I don’t quite 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 that I created. But when one clicks on "See more", it gives "NOT FOUND". I wonder if you have how to use post method in this case, or what 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);
?>
where is your select?
– Luiz Gustavo Costa Ceolin
Look at the Dit, I put it there
– Pedro Ribeiro