Valhalla Legends Archive

Programming => Web Development => Topic started by: PaiD on August 31, 2004, 11:39 PM

Title: [PHP] Delete a txt File
Post by: PaiD 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?
Title: Re:[PHP] Delete a txt File
Post by: hismajesty on September 01, 2004, 07:36 AM
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
Title: Re:[PHP] Delete a txt File
Post by: Banana fanna fo fanna on September 01, 2004, 08:49 AM
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.
Title: Re:[PHP] Delete a txt File
Post by: PaiD on September 01, 2004, 07:44 PM
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