Deleting Files

I’m using a WAMP based PHP setup


chmod($file,0777);
unlink($file);

This throws a permissions error and doesn’t delete the file specified in $file (which is just “index.php”). How do I set the permissions - I can create files, I just can’t delete them :frowning:

Any ideas?