07/08/2009, 18:07
|
| | | Fecha de Ingreso: julio-2008 Ubicación: 18°30'N, 69°59'W
Mensajes: 4.879
Antigüedad: 16 años, 4 meses Puntos: 416 | |
Respuesta: Definir una funcion(algo) y ejecutarla despues Cita: I have founda that trying to delete a file using relative path like the example below does not work. Código PHP: <?php $do = unlink("../pics/$fileToDel"); if($do=="1"){ echo "The file was deleted successfully."; } else { echo "There was an error trying to delete the file."; } ?> I did not work at all, instead what I had to do was: Código PHP: <?php chdir('../pics/'); $do = unlink($fileToDel); if($do=="1"){ echo "The file was deleted successfully."; } else { echo "There was an error trying to delete the file."; } ?> Then it worked ! http://www.php.net/manual/en/function.unlink.php#80110 |