Hi, I am stuck in a simple problem due to checkbox
The problem is that in the value attribute of checkbox I am placing a value which I want to retrieve
echo "<td><input type='checkbox' value='".$row['docid']."' name='asgn[]'>Assign</td>";
after this I am using foreach()
In the output page i get a warning saying
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\docassign.php on line 88
But as soon as I check the checkbox, the warning goes.
Earlier when I was giving Value attribute as '1', no warning was occurring
Here is the whole code
while($row=mysql_fetch_array($rundoc))
{
echo "<td>".$row['doctor']."</td>";
echo "<td>".$row['hospital']."</td>";
echo "<td>".$row['expert']."</td>";
echo "<td>".$row['phone']."</td>";
echo "<td><input type='checkbox' value='".$row['docid']."' name='asgn[]'>Assign</td>";
echo "<td><input type='submit' name='submit' value='Submit'></td>";
echo "<tr>";
}
foreach($_REQUEST['asgn'] as $checkbox)
{
$var = $checkbox;
//echo $var;
}