Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/06/2008, 09:20
josekast
 
Fecha de Ingreso: junio-2008
Mensajes: 7
Antigüedad: 15 años, 11 meses
Puntos: 0
Borrar fichero en servidor 1and1

Buenas tengo un codigo que probado en mi pc en localhost me funciona bien pero al subirlo a mi servidor, en este caso 1and1 me salta el siguiente mensaje:
Código:
Warning: unlink() [function.unlink]: No such file or directory in /homepages/21/d228437082/htdocs/php/borra.php on line 7

Warning: unlink() [function.unlink]: No such file or directory in /homepages/21/d228437082/htdocs/php/borra.php on line 8

Warning: Cannot modify header information - headers already sent by (output started at /homepages/21/d228437082/htdocs/php/borra.php:7) in /homepages/21/d228437082/htdocs/php/borra.php on line 10
Estos son los archivos que uso:
lista_borrar.php
Código PHP:
<html>
<head>
   <title>Borrar</title>
</head>
<body>
<H1>Borrar</H1>

<?php
   
include("conex.phtml");
   
$link=Conectarse();
   
$result=mysql_query("select * from productos ORDER BY producto, fabricante, modelo ASC",$link);
?>
   <table border=1 cellspacing=1 cellpadding=1>
      <tr><td><b>Producto</b></td><td><b>Fabricante</b></td><td><b>Modelo</b></td><td><b>Potencia</b></td><td><b>Caudal</b></td><td><b>Presion</b></td><td><b>PDF</b></td><td><b>IMG</b></td><td><b>Borrar</b></td></tr>
<?php      

   
while($row mysql_fetch_array($result)) {
   
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td><a href=\"%s\" title=\"Ver PDF\" target=\"_blank\"><img src=\"images/pdf.gif\" alt=\"Ver PDF\" border=\"0\" /></a></td><td><a href=\"%s\" rel=\"gb_image[]\" title=\"%s\"><img src=\"images/imagen.gif\" alt=\"Ver PDF\" border=\"0\" /></a></td><td><a href=\"borra.php?id=%d&pdf=%s&img=%s\">Borrar</a></td></tr>"$row["producto"],$row["fabricante"],$row["modelo"],$row["potencia"],$row["caudal"],$row["presion"],$row["pdf"],$row["img"],$row["modelo"],$row["id"],$row["pdf"],$row["img"]);
   }
   
mysql_free_result($result);
   
mysql_close($link);
?>
</table>
</body>
</html>
borra.php
Código PHP:
<?php
   
include("conex.phtml");
   
$link=Conectarse();
   
$id=$_REQUEST['id'];
   
$pdf=$_REQUEST['pdf'];
   
$img=$_REQUEST['img'];
   
unlink("$pdf");
   
unlink("$img");
   
mysql_query("delete from productos where id = $id",$link);
   
header("Location: lista_borrar.php");
?>
Por lo que veo es problema del unlink, se puede borrar de alguna otra manera los archivos subidos?

Gracias.