Page 1 of 1

deleting from a path

Posted: Wed May 10, 2006 10:24 pm
by corillo181
i'm trying to delete a fiel from database and from the dir.. i already can delete it from the database but how i do for the file path..

i have this much going..

Code: Select all

<?php
include'../includes/db.php';
$dir='/userpic/';
$pic=$_GET['delpic'];
$delpath=$dir.$pic;
unlink($delpath);
$co="DELETE FROM userpic WHERE name='$pic'";
$cod=mysql_query($co);
$ed=mysql_fetch_array($cod);
header('Location: index.php');
?>
when i click delete it deletes from the database but can't make it delete from path..

Posted: Wed May 10, 2006 11:31 pm
by Burrito
check out unlink()

Posted: Wed May 10, 2006 11:54 pm
by corillo181
:) it was my fault it was working just that i just a few file with almose the same name.. :oops: