1
I’m having a question on the condition I’m willing to put in my system.
If the ID
the owner of the ad is equal to the one in the session a "accept negotiation" button appears, if not, the "Product on the way" button appears. When testing appears only the button "Accept negotiation".
Follows the code:
<?php
$id_usuario_anuncio = $_GET["ID_usuario"];
$id_usuario_sessao = $_SESSION["id"];
if($id_usuario_anuncio == $id_usuario_sessao)
{
echo '<form method="post" action="">
<input type="hidden" name="ATIVAR/EXCLUIR" value="<?php echo $_GET["ID"]; ?>">
<div class="panel-footer">
<button type="submit" name="ativar" id="ativar" value="ATIVAR"class="botao_cardapio">Aceitar negocição</button>
</div>
</form>';
}
else
{
echo '<form method="post" action="">
<input type="hidden" name="ATIVAR/EXCLUIR" value="<?php echo $_GET["ID"]; ?>">
<div class="panel-footer">
<button type="submit" name="excluir" id="excluir" value="EXCLUIR"class="botao_cardapio">Produto a caminho</button>
</div>
</form>';
}
?>
(I made a comment but deleted because I was not coming to the case)... If you are always entering the first condition, it is because the values are equal. Your problem is coming from elsewhere. SESSION may be empty and $_GET as well.
– Sam