ciao a tutti,

quando clicco sul pulsante cancella invece di cancellarmi il file voluto mi cancella sempre il primo file della lista qualunque esso sia.

Codice PHP:
$sql="DELETE FROM a_filesharing
            WHERE file = '".$deletefile."'";
$query=mysql_query($sql); 

$directory= "$absolute_path/"; 
unlink ($directory.$deletefile) or die('Impossibile eliminare il file: '.$deletefile); 


<form enctype="multipart/form-data" name="form2" action="<?=$PHP_SELF?>" method="post">  

                    <?    
$sql_ins 
"SELECT a_filesharing.*
                  FROM a_filesharing 
                  WHERE a_filesharing.id_login = '
$login'
                  ORDER BY a_filesharing.id_filesharing DESC"
;
$result_ins mysql_query($sql_ins,$conn) or die (mysql_error());
while (
$row mysql_fetch_array($result_ins)){
?>

<input type="hidden" name="deletefile" value="<?=$row['file']?>">

  <table width="570" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="460">

<?=$row['file']?></a></span>

<input name="submit" type="submit" class="pulsante" value="elimina">    

</td>
</tr>
</table>