I'm allowing users to enter some search criteria, and then pass it to a db. The db returns the data to an html table. The problem is that I'm wanting the user to select the record they want to see by clicking on a radion button, then a submit button. In concept, I want the data chosen by the user to be sent to another php page, and then submitt back to the same db, and the full record presented to the user on the screen.
Using the GET method, the code below shows that the correct record is being passed with the URL; however, I am unable to figure how to access the variable on the receiving php page. Any suggestion on how to fix will be appreciated.
Thanks
if (1 >= $count) {
include 'chooseTH.php';
echo "
<table border=\"1\" width=\"800\" cellspacing=\"3\" cellpadding=\"3\" align=\"center\">
<form name=\"form1 \" method=\"GET\" action=\"viewreport.php\">";
while(odbc_fetch_row($rows)){
$incidentnbr=odbc_result($rows,"incidentnbr");
$inciddate=odbc_result($rows,"inciddate");
$deptclass=odbc_result($rows,"deptclass");
$location=odbc_result($rows,"location");
$count = $count + 1;
if(empty($nbr)) {
$nbr = $nbr=1;
}
echo "<tr align=\"left\">
<td align=\"center\">[$nbr]</td>
<td align=\"center\"><input type=\"radio\" name=\"Button+$nbr+$incidentnbr\" ></td>
<td align=\"left\"><i>$incidentnbr</i></td>
<td align=\"left\"><i>$inciddate</i></td>
<td align=\"left\"><i>$deptclass</i></td>
<td align=\"left\"><i>$location</i>
</td>
</tr>";
$nbr = $nbr+1;
}
}
echo
"<tr>
<td colspan=\" 6\" align=\" center\" >
<br /><p align=\"center\"><input type=\"submit\" name=\"submit\" value=\"View Record\" ></p>
</td>
</form>
</tr>
";
}