Delete file using unlink
Posted: Fri Aug 12, 2011 5:47 am
Hi,
I've set up a little upload script and was adding into it a delete function as well...
Basically im trying to parse the following:
I know 'filename' works as I call the filename in a table before this for each individual filename and my output works when i post it to removefile.php i would get a url such as http://www.baseurl.com/removefile.php?f ... 20card.zip - also my alt tag is working.
Inside removefile.php i have:
I am pretty sure this shuldn't be complex? The files are in the same directory as the remove script for the time being as well..
Any help would be appreciated.
Thanks
sam
I've set up a little upload script and was adding into it a delete function as well...
Basically im trying to parse the following:
Code: Select all
<a href="removefile.php?file=files/<?php echo $filename;?>" title="Delete file '<?php echo $filename;?>' from the server">Delete</a>Inside removefile.php i have:
Code: Select all
<?
if(isset($_POST['$filename'])){
unlink($_POST['$filename']);
}
?>Any help would be appreciated.
Thanks
sam