Get name and value using PHP
I have this simple form:
HTML:
<input type="checkbox" name="product[]" value="20$" /> book
<input type="checkbox" name="product[]" value="30$" /> plane
PHP:
$product = $_POST['product'];
foreach($product as $value) {
echo $value;
}
Note: The
user can select one or two ... products.
Question:
I want to know if there is a solution to get nametoo, for example, add an ID class or something like that.
Basically, I cannot get the attribute namebecause I did not submit it with the form.
+3