Ver Mensaje Individual
  #9 (permalink)  
Antiguo 14/05/2008, 10:26
Avatar de trasgukabi
trasgukabi
 
Fecha de Ingreso: septiembre-2004
Mensajes: 2.749
Antigüedad: 19 años, 8 meses
Puntos: 18
Re: Ayuda con eliminar imagen del servidor

prueba ésto
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); 
if (!
$result) { 
$message 'Invalid query: ' mysql_error() . "\n"
$message .= 'Whole query: ' $query
die(
$message); 

header("location: actualizar.php");