Valhalla Legends Forums Archive | Web Development | [PHP] Delete a txt File

AuthorMessageTime
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?
September 1, 2004, 4:39 AM
hismajesty
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
September 1, 2004, 12:36 PM
St0rm.iD
[quote author=DueL link=board=22;threadid=8505;start=0#msg78514 date=1094013584]
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?
[/quote]

Use unlink(). If you have an error, it's most likely do to your CHMOD permissions.
September 1, 2004, 1:49 PM
PaiD
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'
[code]
if($act == "deletedb" ) {
$file = 'public_html/bot/demo/database.db';
Unlink($file);
}
[/code]
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
September 2, 2004, 12:44 AM

Search