deleting from a path
Posted: Wed May 10, 2006 10:24 pm
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..
when i click delete it deletes from the database but can't make it delete from 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');
?>