Hi guys,
I need help in deleting files from folder, normal unlink doesn't help. I'm trying to delete rows from DB and in the same time those files from a folder(I can delete the filenames from DB, but not the files from the folder), could someone please guilde me to solve this problem?
Thanks!
//Deleting from DB
<?
if(isset($_POST['deletefiles_x']) || isset($_POST['deletefiles_y']))
{
//Strat to grab info...
$upload_dir = "members/kikki/";
$total = $_POST['total'];
$td = 0;
$i = 0;
//Delete each selected filenames from DB-------------------------------------->
for($i = 1; $i <= $total; $i++)
{
if(isset($_POST["d$i"]))
{
mysql_query("DELETE FROM members_uploads WHERE id=".$_POST["d$i"]);
$td++;
}
}
echo "$td record(s) deleted!";
//End deleting the filenames from the DB-------------------------------->
//Start Deleting the same files from the folder too :/
//End deleting
}
?>