note 80110 added to function.delete

From: Date: Sun, 30 Dec 2007 00:14:53 +0000
Subject: note 80110 added to function.delete
Groups: php.notes 
Request: Send a blank email to php-notes+get-134271@lists.php.net to get a copy of this message
I have founda that trying to delete a file using relative path like the example below does not work. $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: 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 ! ---- Server IP: 200.185.126.110 Probable Submitter: 201.6.33.208 ---- Manual Page -- http://www.php.net/manual/en/function.delete.php Edit -- https://master.php.net/note/edit/80110 Del: integrated -- https://master.php.net/note/delete/80110/integrated Del: useless -- https://master.php.net/note/delete/80110/useless Del: bad code -- https://master.php.net/note/delete/80110/bad+code Del: spam -- https://master.php.net/note/delete/80110/spam Del: non-english -- https://master.php.net/note/delete/80110/non-english Del: in docs -- https://master.php.net/note/delete/80110/in+docs Del: other reasons-- https://master.php.net/note/delete/80110 Reject -- https://master.php.net/note/reject/80110 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#134271) next »