PHP: deleting files – permission denied – chmod?

Posted by mathiregister on Stack Overflow See other posts from Stack Overflow or by mathiregister
Published on 2010-06-06T19:26:05Z Indexed on 2010/06/06 19:32 UTC
Read the original article Hit count: 233

Filed under:
|

hi guys,

i want to delete files from a directory via php. Somehow my php_errorlog always tells me:

[06-Jun-2010 19:38:46] PHP Warning: chmod() [function.chmod]: Operation not permitted in /Users/myname/htdocs/

if ($_POST) {
        echo "yeah!!!";
        print count($_POST['deletefiles']);
        chmod($path, 0777); //server rights
        foreach ($_POST['deletefiles'] as $value) {
            print $value;
            unlink($path .'/' . $value);
        }
        //chmod($path, 0666); //server rights
    }

what am I doing wrong? Thank you

© Stack Overflow or respective owner

Related posts about php

Related posts about unlink