Hi everyone,
I'm having a problem with arrays.
Before I tell you the problem, let me show you a portion of my code:
<input type="checkbox" name="check" value="
<?php echo $row['someValue'] ?>">
<input type="checkbox" name="check" value="
<?php echo $row['someValue'] ?>">
<input type="checkbox" name="check" value="
<?php echo $row['someValue'] ?>">
So I have three checkboxes in HTML all with the same name. From what I understand that creates an array. Now say the user selects two of them and presses the submit button. It goes to another page where I must $_POST the values like this:
$chkValues = $_POST["check"];
$numElements = count($chkValues);
echo $numElements;
Now I believe I'm wrong but I tried to use a subscript with chkValues and it returns an error. I count the number of elements in chkVales and it always returns 1. How can I get allll the values the user selected. Is chkValues not an array? If anyone can help, it would be greatly appreciated. Thank you
Armond