Hi
I'm having an issue with the chmod. I can't seem to excute the file. Everytime I upload a file and write something it keep saying "Directory is not writable chmod(700)
Here is the code:
function checkPath ($path) {
if (!is_dir ($path)) {
printSecurityText ("Directory does not exist: ".$path."");
return false;
}
else {
if (!is_writable ($path)) {
$tmpFilename = time ().".tmp";
$chmodList = array (0666, 0700, 0744, 0746, 0747);
foreach ($chmodList as $chmod) {
if (chmod($path, $chmod)) {
if ($fh = fopen ($path."/".$tmpFilename, "w+")) {
unlink ($path."/".$tmpFilename);
return true;
}
}
}
printSecurityText ("Directory is not writable: ".$path."");
return false;
}
}
return true;
}
function checkFile ($filename, $fExists=false) {
if ($fExists && !file_exists ($filename)) {
printSecurityText ("File does not exist: ".$filename."");
return false;
}
else
if (!is_writable ($filename)) {
printSecurityText ("File is not writable: ".$filename."");
return false;
}
return true;
}
I appreciate any suggestion. Thanks.