corillo181 Posted May 26, 2006 Share Posted May 26, 2006 so yeah this used to work for me before it delete the name from the database and the folder..but now i tryed to use it with another code and is not work..i changed it in the right places i made this code before and it works but i tried everythign i know and is not working.. can someone see something i'm not seen?[code]if(isset($_POST['Delete'])){$dir="albums/";$pic=$picturedes['fotoname'];$dir='userpic/'.$pic;unlink($dir);$co="DELETE FROM tra_photo WHERE fotoname='$pic'";$cod=mysql_query($co)or die(mysql_error());if($co){echo 'picture deleted!';}else{echo 'could not delete...';}}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10523-why-isnt-this-code-workin/ Share on other sites More sharing options...
AndyB Posted May 26, 2006 Share Posted May 26, 2006 What isn't it doing that you're expecting it to do? Quote Link to comment https://forums.phpfreaks.com/topic/10523-why-isnt-this-code-workin/#findComment-39243 Share on other sites More sharing options...
corillo181 Posted May 26, 2006 Author Share Posted May 26, 2006 [!--quoteo(post=377360:date=May 26 2006, 01:50 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 26 2006, 01:50 PM) [snapback]377360[/snapback][/div][div class=\'quotemain\'][!--quotec--]What isn't it doing that you're expecting it to do?[/quote]it has to delete the name from the database and delete the file with the same name from a directory.. Quote Link to comment https://forums.phpfreaks.com/topic/10523-why-isnt-this-code-workin/#findComment-39250 Share on other sites More sharing options...
nogray Posted May 26, 2006 Share Posted May 26, 2006 is the directory to the file "albums/userpic/.$pic;" or just 'userpic/'.$pic;if it's the first, you need to change $dir='userpic/'.$pic;to $dir.='userpic/'.$pic; Quote Link to comment https://forums.phpfreaks.com/topic/10523-why-isnt-this-code-workin/#findComment-39301 Share on other sites More sharing options...
corillo181 Posted May 26, 2006 Author Share Posted May 26, 2006 not really, it works the way i ha dit.. just had a linking problem.. Quote Link to comment https://forums.phpfreaks.com/topic/10523-why-isnt-this-code-workin/#findComment-39311 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.