Page 1 of 1
quick problem with unlink solved
Posted: Tue Oct 13, 2009 4:07 pm
by scarface222
Hey guys this script does not work. Anyone have an idea of what I did wrong?
Code: Select all
$myFile = "usercontent/$user/audio";
$fh = fopen($myFile, 'w') or die("can't open file");
$myFile = "usercontent/$user/audio/$mp3";
unlink($myFile);
fclose($fh);
Re: quick problem with unlink
Posted: Tue Oct 13, 2009 4:30 pm
by requinix
scarface222 wrote:Anyone have an idea of what I did wrong?
Yep: you assumed we knew exactly what this code is all about, knew exactly what the variables were and what values they had, and could easily identify any possible problem that may exist.
Give a description. Background on the project. Details of the error. Error messages if you have any.
Re: quick problem with unlink
Posted: Tue Oct 13, 2009 5:01 pm
by scarface222
there is a file ($mp3) I need deleted within a folder ($user=g) within a folder (audio). I wanted to know if my form for my unlink script was correct. As in did I take the right steps to get to the file I want and delete it. Sorry I was in a rush and worded the question poorly.
this is the error I have now that I have tested it properly
Warning: fopen(usercontent/g/audio) [function.fopen]: failed to open stream: Permission denied in C:\Web Files\wamp\www\y\testing123.php on line 13
can't open file
Re: quick problem with unlink solved
Posted: Tue Oct 13, 2009 9:02 pm
by scarface222
solved it myself i needed to change the folder access to 666.