<button class="btt"><a href="carrinho.php?prod=<?= $skins['id_skin']?>">Comprar</a></button>
Well I wanted to check if the person actually clicked on the button and if the get = cart.
<button class="btt"><a href="carrinho.php?prod=<?= $skins['id_skin']?>">Comprar</a></button>
Well I wanted to check if the person actually clicked on the button and if the get = cart.
The
<a>
element can not be descended from the<button>
element.
You can include one more URL parameter with a value name carrinho
:
carrinho.php?prod=<?=$skins['id_skin']?>&clique=carrinho
In PHP you check whether the clique
parameter is equal to carrinho
:
$prod = $_GET['prod'];
$clique = $_GET['clique'];
// $clique igual a "carrinho" e $prod não é vazio
if($clique == "carrinho" && !empty($prod)){
// fazer algo
}