i cant get it to delete anything here is the complete script
<html>
<head>
<title><? echo $login; ?>'s File Management</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#AFC0D0" text="#000000">
<FORM ENCTYPE="multipart/form-data" ACTION="<? $PHP_SELF ?>" METHOD="POST">
<?php
$file_array = array();
function GetDirArray($sPath)
{
global $file_array;
$handle=opendir($sPath);
$i=0;
while (false!==($file = readdir($handle)))
{
if ($file != "." && $file != ".." &&
(strtolower(substr($file,-3))=='jpg' || strtolower(substr($file,-3))=='png' || strtolower(substr($file,-3))=='jar' || strtolower(substr($file,-3))=='jad' || strtolower(substr($file,-3))=='mid' || strtolower(substr($file,-3))=='qcp' || strtolower(substr($file,-3))=='cmx' || strtolower(substr($file,-3))=='pmd' || strtolower(substr($file,-3))=='jpe'))
{
$file_array[]= $file;
$i++;
}
}
closedir($handle);
sort($file_array);
}
$sPath = dirname($PATH_TRANSLATED) . "/$login/";
GetDirArray($sPath);
if (isset($delete))
{
echo "Now deleting...<br />\n";
//assume form uses POST method
//check that at least one checkbox checked
if (isset($_POST['checkbox_file']))
{
//loop through the checked checkboxes
foreach ($_POST['checkbox_file'] as $file_key)
{
//is the value of the checkbox valid?
if (array_key_exists($file_key))
{
//delete the file
unlink($login . "/" . $file_array[$file_key]);
echo "Deleting {$file_array[$file_key]} <br />\n";
}
}
}
}
else
{
$num = count($file_array);
for ($i = 0; $i < $num; $i++)
{
echo "<input type=\"checkbox\" name=\"checkbox_file[{$i}]\" value=\"{$i}\">{$file_array[$i]}<br>\n";
}
}
?>