Page 1 of 1

clicking a link to delete a file

Posted: Fri May 21, 2004 9:44 pm
by neobolt
I'm trying to create a link, so when the user clicks the link it will delete a file from a directory.

I've been messing around with the unload command with no success.

This is so a member can download a text database file. Then I need them to click the delete database link so that the database file gets deleted, so when new information is sent, a new database is created.

All I need to know is how to delete a file from my server by clicking a link.

Thanks

Posted: Sat May 22, 2004 12:51 am
by doggy
this link will help you out fopen http://za2.php.net/manual/en/function.fopen.php
use fopen to open to that dir and then delete the file.
Hope this helps

Posted: Sat May 22, 2004 5:41 am
by launchcode
You use the unlink() function to delete a file via PHP. But you have to have (1) Permissions to do so and (2) Give it the full path to the file.