Hi there,
I have a page that has 20 checkboxes and I need to put the array I am using
eg: productid[]
into a string like this
"idcalue1, idvalue2, idvalue3..." to pass with the form.
How do I do that?
Code for the checkboxes:
'<INPUT TYPE="CHECKBOX" NAME="ProductId[]" VALUE="'. $listing['products_id'] . '"> </INPUT>';
// Where the $listing variable pulls the id from the database
The form: Whereyou can see my noobi-ness with this topic.
<?php echo '<form name="cart_quantity" method="post" action="http://www.xxxx.com/xxxx_xxx.php"> <input type="hidden" name="action" value="add_products">
<input type="hidden" name="products_id" value="' . $ProductId . '"> <input type="submit" value="Add To Cart"></form>';
?>
Can someone suggest how I achieve this? I thought using implode but my code:
$myproduct_id=implode(",", $ProductId);
...gave me an error.
Thanks in advance
Simon