0
I am trying to send two parameters of the shopping cart through the url ,for later the client to make the confirmation, but I can only receive an array on the other page and do not know how to receive two.
I want to send the quantity of products and the id_products to another page, where the user will confirm and then enter database.
On the cart page
<?php
**// array para guardar todos os valores que estão no carrinho
$emparray[] = $product['id_produto'];
$quant[] = $product['quantidade'];
...
// transformar a array numa associação de parâmetros para a url
$query = http_build_query($emparray);
testar = http_build_query($quant);
$cart_box .= '<div class="cart-products-total">Total : '.$total.' € <u><a href="index.php?page=confirmar_encomenda&'.$query.'&'.$testar.'" title="Verifica o carrinho e faz checkout">Concluir</a></u></div>';
?>
On the other page, this is how I receive the values. In order to send in the form confirmation.
<?php
$teste=$_GET;
echo $teste;
foreach($teste as $value){
echo' <input type='text" name="result[]" value="'. $value.'">';
}
?>
But this way he only shows the last array and I’ve tried N ways to receive the two separately but could not.
Hello, you are badly constructing the array, passing the parameters, and also overloading the reception, read this here.
– Edilson