Lies dir hier vielleicht mal die Diskussion zu unlik durch:
http://de3.php.net/manual/de/function.unlink.php
Speziell dieser Kommentar hier ist mir ins Auge gefallen:
Zitat:
I have founda that trying to delete a file using relative path like the example below does not work.
<?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:
<?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 !
Dazu noch dieser Ausschnit aus nem andern Kommentar:
Code:
<?php
$old = getcwd(); // Save the current directory
chdir($path_to_file);
unlink($filename);
chdir($old); // Restore the old working directory
?>