Multiple checkboxes
| From: | Mike Baerwolf | Date: | Thu, 07 Aug 2003 00:31:57 +0000 |
| Subject: | Multiple checkboxes | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-29730@lists.php.net to get a copy of this message | ||
Hello,
I'm trying to get the values from a form post with multiple checkboxes checked . Here is what I have,
if ($row = mysql_fetch_array($result));
do {
<input type=checkbox name=class_id[] value=$row[class_id]> $row[name]
}while ($row = mysql_fetch_array($result));
and when submitted
if ($class_id) {
foreach($class_id as $varName)
print "Variable: $varName\n";
}
All I get from this is Invalid argument supplied for foreach(). From what I could find doing a google search was to create an array using class_id[] and the above foreach().
Thanks in advance for any help!
Mike