Ver Mensaje Individual
  #12 (permalink)  
Antiguo 14/05/2008, 12:10
MadKat
 
Fecha de Ingreso: marzo-2008
Mensajes: 171
Antigüedad: 16 años, 2 meses
Puntos: 0
Re: Ayuda con eliminar imagen del servidor

Prueba asi

Código PHP:
//recibimos la variable $id 
$id=$_GET[id];
$resultado=mysql_query("select * from propiedades where id = $id",$enlace); 
$row=mysql_fetch_array($resultado);  
    
$imagen=$row["imagen"]; 
    
//si hay alguna imagen que borrar se borra 
    
if ($imagen=='/images/')
        
unlink($imagen);   
        
//RETRASAR MEDIO SEGUNDO
         
usleep(500000);
//borramos los registros pertenecientes a la id 
$result mysql_query("delete from propiedades where id='$id'",$enlace); 
unlink($imagen);
if (!
$result) { 
$message 'Invalid query: ' mysql_error() . "\n"
$message .= 'Whole query: ' $query
die(
$message); 

header("location: actualizar.php"); 
Besos, Agus.