How would I go about deleting a txt file? It is a txt file and in the same dir as the script. I have tried unlink with no luck=/ any1 know?
http://us4.php.net/manual/en/function.delete.php
You could, optionally, open an ftp connection.
http://us4.php.net/manual/en/function.ftp-delete.php
Quote from: DueL on August 31, 2004, 11:39 PM
How would I go about deleting a txt file? It is a txt file and in the same dir as the script. I have tried unlink with no luck=/ any1 know?
Use unlink(). If you have an error, it's most likely do to your CHMOD permissions.
Ok this is what I have and tested it but it still doesnt work. I dont get any error just wont delete it.
CHMOD: '777'
File: 'bot.php?deletedb'
if($act == "deletedb" ) {
$file = 'public_html/bot/demo/database.db';
Unlink($file);
}
Also just tired changing $file to 'database.db' but it didnt work.
Edit: Sry found the problem :o I did 'bot.php?deletedb' and not 'bot.php?act=deletedb' lol. thx to every1 who helped me