desarrollé un sitio con un administrador bien simple, creo que me he saltado varios aspectos de seguriad... en fin, en una parte me borra registros que tienen asociada una fotografía y mediante unlink() me borra también la fotografía del servidor.
Esto funcionó bien en mi PC, pero al omento de subirlo no está funcionando, y me tira este mensaje de error:
Warning: unlink(): No such file or directory in /home/xxxxxxx/public_html/administraxxxx/arriendos/borrar.php on line 9
El código del archivo es:
Código PHP:
include("../conex.php");
$link=Conectarse();
$result=mysql_query("delete from tabla where Id=$Id",$link);
$path="../../sistema/photo";
if($nomfoto1 != "no_foto1.jpg")
$file1=$path."/".$nomfoto1;
unlink($file1);
if($nomfoto2 != "no_foto2.jpg")
$file2=$path."/".$nomfoto2;
unlink($file2);
if($nomfoto3 != "no_foto3.jpg")
$file3=$path."/".$nomfoto3;
unlink($file3);
XMEDIA
