I am having a problem programming the code for a 'POST' form. I can't seem to get anything out of $_POST[]. Below is what I think are the relevant sections of code:
Bascially I am creating a table with contains extracted file names and for each file there is a radio button for its disposition. Setting aside the attempt to set up the radio buttons names as an array, I cannot get anyting values out of the 'echo' near the bottom. The page displays fine and the source looks good. But when the submit button is pressed no values are retreived from $_POST. I need help understadning how to use $_POST to get my radio buttton values.
TIA.
Code:
<?php
$dir="e:/ftp-root/uploads/sors/";
$alias="ftp-sors/";
$dh=opendir($dir);
$i=1;
if(!isset($_POST['Submit']))
{
?>
<form name="SORSAdministration" action="sorsreview.php" method="post">
<table border="0" summary="">
<tr>
<td width="275"><b><font size="+1" color="#008000">File Name</font></b></td>
<td width="58"><b><font size="+1" color="#008000">Accept</font></b></td>
<td width="58"><b><font size="+1" color="#008000">Reject</font></b></td>
<td width="58"><b><font size="+1" color="#008000">Defer</font></b></td>
<td width="275"><b><font size="+1" color="#008000">File Name</font></b></td>
<td width="58"><b><font size="+1" color="#008000">Accept</font></b></td>
<td width="58"><b><font size="+1" color="#008000">Reject</font></b></td>
<td width="58"><b><font size="+1" color="#008000">Defer</font></b></td>
</tr>
<?php
while (false !== ($file=readdir($dh))) if (is_file($dir.$file))
{
if ($file !== ".htaccess")
{
if ($i % 2 !== 0) echo "<tr>\n";
echo "<td width=\"275\"><font size=\"+1\" color=\"#008000\"><a href=\"[URL unfurl="true"]http://$SERVER_NAME/$alias$file\">$file</a></font></td>\n";[/URL]
echo "<td width=\"58\"><font size=\"+1\" color=\"#008000\"><input type=\"radio\" name=\"Disposition$i\" value=\"Accept\"></font></td>\n";
echo "<td width=\"58\"><font size=\"+1\" color=\"#008000\"><input type=\"radio\" name=\"Disposition$i\" value=\"Reject\"></font></td>\n";
echo "<td width=\"58\"><font size=\"+1\" color=\"#008000\"><input type=\"radio\" name=\"Disposition$i\" value=\"Defer\" CHECKED></font></td>\n";
if ($i % 2 == 0) echo "</tr>\n";
$i++;
}
}
if ($i % 2 !==0) echo "</tr>"; // last entry might need row ender
closedir($dh);
?>
</table><br>
<input type="submit" name="Submit" value="Submit">
</form><br>
<?php
}
else
{
while (false !== ($file=readdir($dh))) if (is_file($dir.$file))
{
if ($file !== ".htaccess")
{
$disp=$_POST['disposition1'];
echo "disposition=$disp<br>";
$i++;
}
}
closedir($dh);
}
?>
TIA.