You know, you look at this stuff over and over sometimes and forget the littles that you should, then you post it and someone points it out then you feel stupid.
the $fid needed to be defined and some other little clean ups.
End results :
<?php
// change this to your path (NO TRAILING [ / ])
$dir = "/path/to/dir/files";
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table border=0 cellpadding=2 cellspacing=0 width=380 align=center>
<tr>
<td width=40 align=center valign=middle bgcolor=336699 nowrap height=21>
</td>
<td width=240 valign=middle bgcolor=336699 nowrap>
<font size=2 color=FFFFFF><B>File Name</B></font></td>
<td width=80 align=center valign=middle bgcolor=336699 nowrap>
<font size=2 color=FFFFFF><B>File Size</B></font></td></tr>
<?php
$fid= $_POST['fid'];
if (("submit")&&($fid != "")) {
foreach($fid as $rfn) {
$remove = "$dir/$rfn";
unlink($remove);
}
}
$handle=opendir($dir);
while (($file = readdir($handle))!== false){
if ($file != "." && $file != "..") {
$size = filesize("$dir/$file");
$list .= '<tr><td width="40" align="center" valign="middle" bgcolor="93BEE2" nowrap height="21">';
$list .= '<input type="checkbox" name="fid[]" value="'.$file.'"></td>';
$list .= '<td width="240" valign="middle" bgcolor="93BEE2" nowrap>';
$list .= '<font size="2" color="336699">'.$file.'</font></td>';
$list .= '<td align="center" width="80" valign="middle" bgcolor="93BEE2" nowrap>';
$list .= '<font size="2" color="336699">'.$size.' Kb</font></td></tr>';
}
}
closedir($handle);
echo $list;
?>
<tr>
<td colspan="3" align="center" valign="middle" bgcolor="336699" nowrap height="21">
<font size="2" color="FFFFFF"><input type="submit" value="Remove"></font></td></tr></table>
</form>
Thanks again.