dear all, i wrote this script, but there's an error with my script. class firstclass { var $tmpdir; function definetemp() { $this->tmpdir = "tmp"; } function deltree($path) { if (is_dir($path)) { $entries = scandir($path); foreach ($entries as $entry) { if ($entry != '.' && $entry != '..') { deltree($path.DIRECTORY_SEPARATOR.$entry); } } rmdir($path); } else { unlink($path); } } } $classone = new firstclass(); class secondclass { function action(){ global $classone; // ? -> this should do action of deltree function <- ? $classone->deltree($classone->tmpdir); } function whatever(){ // ... } } $classtwo = new secondclass(); // call action function $classtwo->action(); PHP: thank you very much for any kind of help. best regards
it gives this error "Warning: unlink() [function.unlink]: No such file or directory in ..... on line 30" probably because you defined the path as TMP.. and that is not a folder... because there is "is_dir" function on function deltree... I think it is the problem