0
I’m having a problem when it comes to putting a block page...
When I put the block at the top of the site, that case was using it:
if(!empty($_SESSION['id'])){
echo "Olá ".$_SESSION['nome'].", Bem vindo <br>";
echo "<a href='sair.php'>Sair</a>";
}else{
$_SESSION['msg'] = "Área restrita";
header("Location: login.php");
}
He gives me that mistake: headers already sent
Because of that line on my page:
> if(mysqli_affected_rows($conn)){ $_SESSION['msg'] = "<p
> style='color:green;'>Item apagado com sucesso</p>";
> header("Location: adm_tabela.php"); **//Essa Linha que dá o erro**
How to make her lock so that no error ?
It is because you are making two redirects. You have to finish the script on
else
... Try putting adie();
after the lineheader("Location: login.php");
in theelse
– gustavox
Related: https://answall.com/q/4251/23400
– gustavox