I have a PHP script
<?
$rb = $GET['rb']; // value of rb got from previous form
connectToDB();
$sql="select * from category where cat='$rb' and visible='TRUE' order by cat_name";
$res=mysql_query($sql);
$submit = $POST['submit'];
?>
<form method = "POST" value = "prod2.php">
<table cellSpacing="0" cellPadding="3" width="70%" align="center" border="1" bordercolor="#cccccc" id="table5">
<tr bgColor="#cccccc">
<td align="middle" colspan="2">
<font face="Verdana, Tahoma, Arial" size="2"><b>
<font color="#cc0033">Choose Category </font></b></font>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<?php
while($arow=mysql_fetch_array($res))
{
?>
<tr>
<td><b><font color="#cc0000" face="Verdana, Tahoma, Arial" size="2"> <?php print $arow[cat_name]; ?></font></b></td>
<td><font face="Arial" size="2">
<input type="radio" value="<?php print $arow[cat_id]; ?>" name="sel_catid[]" checked><? print $arow[cat_id];?></font></td>
</tr>
<?
} // cat name
?>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" name="submit" value="Submit" style="font-family: Verdana, Tahoma, Arial; font-size: 8pt">
</td>
</tr>
</table>
</form>
How will I pass the value of sel_catid[] to the next form prod2.php
The values displayed in front of the categories have been derived from the database with the help of the variable $arow[cat_id];
I had tried to pass the values with the help of
foreach ($arr as $sel_catid){
echo $sel_catid[arr];
}
but in vain.
Kindly Correct me where I am going wrong.