Hi could someone help me out with this code please?
I have commented what it should do(or ewhat I want it to do!)
if(isset($_POST['remove'])){
$chk = (array) $_POST['remove'];
$p = implode(',',array_keys($chk));
$q = mysql_query("DELETE FROM image_gallery WHERE id IN ($p)");
$t = mysql_query("SELECT filename from image_gallery WHERE id IN ($p)"); //filename is the path of the file.. eg. image/siteimages/logo.gif
$s = mysql_query("DELETE FROM thumbs_gallery WHERE id IN ($p)");
if ($sql = $s){
$q;
unlink($t); //this isnt doing anything at all
header( 'Location: lee_remove.php' ) ;
}
The entries get deleted from both tables ok, but the image file does not get deleted from the dir.
Can anyone point out where im going wrong??
Thanks for looking...............