2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by mathieu89
3
<?php $name=$_GET['name'];
$target = "../upload/$name"; 
$myFile = $target;
unlink($myFile);

This is a piece of code that i have used once before. In this case i have got the file name after it was posted to the url. The unlink part is the bit where it deletes the file.

Make sure you use proper security. In this case the user could potentially change the url from .php?name=file1 to .php?name=file2 and therefore delete file2 aswell.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.