Welcome Guest, Not a member yet? Register   Sign In
file delete problem

hi there
i am trying to delete one file from localhost.
but it fails.
i write:
where $exists_image is the file name.
but if i print the code it shows the right path.
for example
is my code wrong?

You might want to read the documentation a little more carefully...

Quote:You might want to read the documentation a little more carefully…

thanks. but i wrote this post after reading the documentation and several tries.

Read it again.

Ok, I think rather than repeatedly saying 'RTFM' it might be worth taking the 1 minute of my time to actually help this fellow.

The delete_files function doesn't use the second parameter as you are trying to use it.
The second parameter is TRUE or FALSE, where true means it will recursively delete all sub folder/files as well.

You might want to look an unlink (http://au2.php.net/manual/en/function.unlink.php) as this is more suitable to delete a single file.

<sigh> Apparently you're not familiar with or don't subscribe to the give a man a fish/teach a man to fish theory. Tongue

no i do.. but if he/she asks twice.. insisting they have read the manual.. then clearly they are fundamentally missing something when reading the manual. i.e. read a sentence and misinterpreting it... reading it 100 more times isn't going to change it.

thanks. it works nicely.
may be delete_files() cannot delete single file.
but in a previous post one says:
Quote:Hey. I’m trying to write some code that deletes an image from a server. I’m using this code but for some reason it won’t delete the file:


Now the URL works fine, if I print an <img> tag with that URL then it displays the image. But for some reason it just won’t delete it
and others reply him. for this i think it is possible to use delete_files() for deleting single file.

to 座頭市:
if you not interested then must ignore posts.

Theme © iAndrew 2016 - Forum software by © MyBB