• Welcome to Valhalla Legends Archive.
 

[PHP] Delete a txt File

Started by PaiD, August 31, 2004, 11:39 PM

Previous topic - Next topic

PaiD

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?


Banana fanna fo fanna

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.

PaiD

#3
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