Thursday, 15 August 2013

getting the value of multiple radiobuttons on a different page in php

getting the value of multiple radiobuttons on a different page in php

I have been trying to make a system for my school and some of the code is
giving me a problem. i have a teachers page on which i input some details
from a database and give a radiobutton with each record. when the user
clicks submit it is supposed to go to a different page and put only the
records into a differnt table for which the radiobutton was checked. The
code for making the radiobutton is
while($row=mysql_fetch_array($sqlquery))
{
echo "<tr> <td>$row[Name]</td><td>
$row[Number]</td><td>$row[Form]</td><td>
$row[Outings_left]</td><td>$row[Night_outings_left]</td> <td><input
type='radio' id='$c' name=' $c' value='checked' /></td><td><input
type='date' id='$sd' name='$sd' /></td><td><input type='date' id=' $ed '
name=' $ed' /></td></tr>";
$arr= Array($n=> Array(1=>'row[name]', 2=> 'row[number]') );
$c++;
$sd++;
$ed++;
}
Note- there are also two date fields getting the values in a similar manner
on the other page i am trying to check whether the radiobutton is checked
in teh following manner. but this is showing that all the radoibuttons are
unchecked
$cb1=$_POST['$c'];
echo $cb1;
if($cb1=='checked')
{
echo "entered";
}

No comments:

Post a Comment