Delete file in the server

admin

Administrator
Staff member
Dear all,

Through php, I would like to delete files in the server, the filename is extracted from the database and The file is deleted using the following statement

----------------------------------
$delete = unlink("img/".${$file});
if($delete)
{
echo "Successfully deleted";
}
else
{
echo "Could not delete";
}
-----------------------------------

but the error prompts out,
-------------------
Warning: Unlink failed (Permission denied) in d:\apache group\apache\htdocs\school\php\upload\upload3.php on line 15
------------------------------

Please give me helping hand, thanks

Simon
 
Back
Top