I'm trying to develop a generic processing page that will accept POST requests and insert information into a table based on the field values of a form. I need to step through each field in the $POST array and insert that into a SQL table. The problem I'm having is mutli-value checkbox fields. The $POST array only seems to store the last value. Even when I do a var_dump($_POST) I only get the last value of the particular checkbox array, not the entire thing.
Right now I'm trying to use a foreach loop to go through the values so it looks like this:
foreach ($_POST as $key => $value) {
some processing goes here
}
What is wierd is that even when I do a var_dump($_POST) I get just the last value of the checkbox.
Here's a sample of the Checkbox HTML code:
<INPUT type=checkbox value=1 name="q11">Value1
<INPUT type=checkbox value=2 name="q11">Value2
<INPUT type=checkbox value=3 name="q11">Value3