ciao, ho realizzato una fotogallery, ora però non riesco a far funzionare il pulsante elimina foto sia dal db, sia dalla directory dove risiede fisicamente l'immagine:

Codice PHP:
 <form enctype="multipart/form-data" name="deletefoto" action="<?=$PHP_SELF?>" method="post">  
<table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                                  
                                  <?php 
                                $i
=1;


$sqlgallery2 "SELECT a_photogallery.*
                  FROM a_photogallery 
                  WHERE a_photogallery.id_login = '
$login'
                ORDER BY id_photogallery DESC"
;
$resultgallery2 mysql_query($sqlgallery2,$conn) or die ("errore ".mysql_error());

                                while(
$rowgallery2 mysql_fetch_array($resultgallery2)){
                                
?>
                                <?php
                                
if ($i==1){ echo "<tr align=\"center\" valign=\"top\">";
                                } 
                                
?>
                    <td align="center">
                       
<table width="10" height="10" border="0" cellpadding="5" cellspacing="0">
  <tr>
    <td>[img]../pann_contr_comune/images_photogallery_utenti/<?=$rowgallery2['foto_big']?>[/img]</td>
  </tr>
    <tr>
    <td align="center">
<input type="submit" name="submit" value="elimina"><input type="hidden" name="delete" value="<?=$rowgallery2['id_photogallery']?>"></td>
  </tr>
</table>



</td>
                        <?
                            
if ($i==4){
                                echo 
"</tr><tr align=\"center\" valign=\"top\"><td height=\"6\"></td><td></td><td></td></tr>";
                                
$i=0;
                            }
                             
$i++;
                        }
?>

                                </table>



<?
if ($delete){
$sql="DELETE FROM a_photogallery 
            WHERE a_photogallery.id_photogallery = '"
.$rowgallery2[id_photogallery]."'";
$query=mysql_query($sql);
$msgeliminato "FOTO ELIMINATA";
}
?>        
</form>