Jump to content

Archived

This topic is now archived and is closed to further replies.

corillo181

why isn't this code workin

Recommended Posts

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]

Share this post


Link to post
Share on other sites
What isn't it doing that you're expecting it to do?

Share this post


Link to post
Share on other sites
[!--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..

Share this post


Link to post
Share on other sites
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;

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.