I am having difficulties dealing with form that passes an array. I have included 5 variables ("$a,$b,$c,$d,$e") in an array called $product, then I passed it to another frame use form along with an input that requires user typing in a value. So there would be a array and an input being passed at the same time. So should I use "post" or "get"? It seems I should use "post" to pass the array, but the user input could only be passed via "get" right? Following is the code I had (the form is inside a table):
print "<td><form class=button action='bottom_right.php' method='post' target='bottom_right'>
<input type='text' name='quantity'>
<input type='hidden' name='product' value='<?php echo($product) ?>'>
<button type='submit' class='btn btn-primary mb-2'>Add</button>
</form></td>";
Besides, how could I retrieve the contents from another frame? Should that be something like below? How could I echo a single variable from the array?
<?php
session_start();
$quantity=$_POST['quantity'];
$product=$_POST['product'];
echo $quantity;
echo $product['a'];
echo $b;
?>
Looking forwards to your reply! Cheers!
value='<?php echo($product) ?>.value='<?php echo(Array()) ?>(with an array to string conversion notice.)$productarray, some example values, and an example of what you're trying to get out of it when the form is submitted?var_dump($product), please?