corillo181 Posted February 15, 2007 Share Posted February 15, 2007 ok i gave up on my first task, but i need this done so i changed it to a different way now i dont know what i still cant delete it from the file.. any one see the problem? if(isset($_POST['Submit'])){ $name=$_POST['delete']; $qry = mysql_query("DELETE FROM tra_userpic WHERE picname='$name'")or die(mysql_error()); unlink('userpic/'.$name); if($qry){ $thumb= mysql_query("DELETE FROM tra_userpic_thumb WHERE name='$name'")or die(mysql_error()); $ad='userpic/tn'.$name; unlink($ad); } } Quote Link to comment https://forums.phpfreaks.com/topic/38700-unlink/ Share on other sites More sharing options...
papaface Posted February 15, 2007 Share Posted February 15, 2007 If you could tell us the problem you are having, that may help. Make sure that $_POST['delete'] actually has a value. Quote Link to comment https://forums.phpfreaks.com/topic/38700-unlink/#findComment-185882 Share on other sites More sharing options...
corillo181 Posted February 15, 2007 Author Share Posted February 15, 2007 i want to delete the picture out of the folder.. delete has the value because it deletes the thumb and the original picture out of the database. but it don't from the folder.. and i got it in another script where unlik delete the pictures in the folder but i dont know why is not wokring.. Quote Link to comment https://forums.phpfreaks.com/topic/38700-unlink/#findComment-185891 Share on other sites More sharing options...
papaface Posted February 15, 2007 Share Posted February 15, 2007 does $name include the file extention of the file you want to delete? Quote Link to comment https://forums.phpfreaks.com/topic/38700-unlink/#findComment-185893 Share on other sites More sharing options...
corillo181 Posted February 16, 2007 Author Share Posted February 16, 2007 yes.. it does.. Quote Link to comment https://forums.phpfreaks.com/topic/38700-unlink/#findComment-185903 Share on other sites More sharing options...
papaface Posted February 16, 2007 Share Posted February 16, 2007 Check that the directories are chmod'ed correctly to allow you to delete the files. Quote Link to comment https://forums.phpfreaks.com/topic/38700-unlink/#findComment-185906 Share on other sites More sharing options...
corillo181 Posted February 16, 2007 Author Share Posted February 16, 2007 yeah i changed it to 777 Quote Link to comment https://forums.phpfreaks.com/topic/38700-unlink/#findComment-185907 Share on other sites More sharing options...
papaface Posted February 16, 2007 Share Posted February 16, 2007 Put error_reporting(E_ALL); ini_set('display_errors', '1'); at the top of your page and it will tell you what the error is. Quote Link to comment https://forums.phpfreaks.com/topic/38700-unlink/#findComment-185910 Share on other sites More sharing options...
corillo181 Posted February 16, 2007 Author Share Posted February 16, 2007 it doesn't shoq any problems. Quote Link to comment https://forums.phpfreaks.com/topic/38700-unlink/#findComment-185912 Share on other sites More sharing options...
corillo181 Posted February 16, 2007 Author Share Posted February 16, 2007 ah i found it i was linking the submit to a different page... Quote Link to comment https://forums.phpfreaks.com/topic/38700-unlink/#findComment-185919 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.