Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/07/2012, 16:52
rpichinu
 
Fecha de Ingreso: noviembre-2010
Mensajes: 208
Antigüedad: 13 años, 5 meses
Puntos: 3
Ayuda:Eliminar Imagen Directorio unlink

Necesito que al seleccionar el input typo radio...me pueda eliminar la imagen...al presionar el boton submit


Código PHP:

<?php 
    
echo "<form action='' method='post'>";
    if (
$gestor opendir('files')) {
       
$i=0;    
        while (
false !== ($arch readdir($gestor)))
         {
           if (
$arch != "." && $arch != "..")
             {
                echo 
"<input type='radio' name='$i'><a href=\"files/".$arch."\" class=\"linkli\">".$arch."</a>\n";
                echo 
"<br />";
            
                if(
$_POST[$i] == "/files/".$arch)
                 {
                 echo 
"<p> NOTA: Se eliminara:</p> ".$_POST[$i];
                 
unlink($_POST[$i]);
                  }
//fin if
                     
}//fin if
               
                 
}//fin while
       
$i++;
       echo 
"<input type='submit' value='Eliminar' />";
       
closedir($gestor);
        
    }
//fin if mayor
    
echo "</form>";
    
?>

esto es lo que e intentado y no me resulta.