I have my users choosing from several radio buttons on a page(page1). When they click "submit" they should be given a table of results on another page(page2). Depending on which one they choose an X will appear in the correct box.
My problem is with the name of the radio buttons I think.
Code for page1 is:
<FORM method='POST' action='friday1.php'><table border=1><tr>
<td>Requirement Type</td><td>Currently In Place</td><td>Required-Essential</td><td>Required-Recommended</td></tr>";
echo"<tr><td><strong>1 - Operational</strong></td></tr>";
$productsql1 = "SELECT * FROM survey WHERE rtid=1";
$productResults1 = mysql_query($productsql1);
while ($productRow1 = mysql_fetch_array ($productResults1)){
$ProductName1 = $productRow1["requirement_txt"];
echo"
<tr>
<td>$ProductName1</td>
<td><INPUT type='radio' name='myradio[{$productRow1['id']}]' value='Currently In Place' CHECKED></td>
<td><INPUT type='radio' name='myradio[{$productRow1['id']}]' value='Required Essential'></td>
<td><INPUT type='radio' name='myradio[{$productRow1['id']}]' value='Required-Recommended'></td></tr>
</tr>";}
And for page2 (friday1.php):
if($POST['myradio'] == "Currently In Place") {
$s= "X";
}
elseif($POST['myradio'] == "Required Essential") {
$t = "X";
}
else {
$u= "X";
}
echo"
<table border='1'><tr>
<td>Requirement Type</td><td>Currently In Place</td><td>Required-Essential</td><td>Required-Recommended</td><td>i-Clean Solution</td></tr>";
echo"<tr><td><strong>1 - Operational</strong></td></tr>";
$productsql1 = "SELECT * FROM survey WHERE rtid=1";
$productResults1 = mysql_query($productsql1);
while ($productRow1 = mysql_fetch_array ($productResults1)){
$ProductName1 = $productRow1["requirement_txt"];
echo"
<tr>
<td>$ProductName1</td>
<td><center><strong>$s</strong></center></td>
<td><center><strong>$t</strong></center></td>
<td><center><strong>$u</strong></center></td>
<td>Module 1</td>
</tr>";}