Ver Mensaje Individual
  #4 (permalink)  
Antiguo 03/01/2007, 06:52
pintix
 
Fecha de Ingreso: octubre-2004
Ubicación: Barcelona
Mensajes: 195
Antigüedad: 20 años, 4 meses
Puntos: 7
Re: NO HAY QUIEN ME AYUDE??--Problema al borrar archivo del servidor

Cita:
Iniciado por alllebor Ver Mensaje
(...)

Código PHP:
<?
    mysql_connect
("****","*****","*****");
    
mysql_select_db("*****"); 
    
$id=$_GET['id'];
    
mysql_query("select from noticias where id = $id");
    
$imagen=$row["imagen"];
    
//si hay alguna imagen que borrar se borra
    
if (!($imagen=='fotos/'))
        
unlink('$imagen'); 
        
    
mysql_query("delete from noticias where id = $id");
    

    
header("Location: ./noticias.php");   
?>
(...)
En este código que has puesto tienes una variable entre comillas simples que tienes que quitar para que la variable coja el valor... tiene que ser así:
Código PHP:
unlink($imagen);