Forum Moderators: coopster

Message Too Old, No Replies

Php Unlink Help

         

BlackRaven

10:32 pm on Jan 16, 2006 (gmt 0)

10+ Year Member



I am having diffucity with the php unlink. For some reason it wont delete the file specified from the $id variable. If i replace $id with something like 'test'

$fname = '../cache/test.html';
unlink($fname);

works however the below doesnt....Any help much appreciated. thanks

$fname = '../cache/'.$id.'.html';
unlink($fname);

coopster

10:42 pm on Jan 16, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Should be working exactly the same. You may want to dump that $id variable or even the $fname variable prior to your unlink() function just to see what those vars contain. Maybe they aren't populating with the values you expect.