$directory = 'images/author_pic/james';
if(check_dir($directory))
{
echo "Direcotry Created"
} else {
echo "directory not created something went wrong!";
}
// create writable directory or change the chmod permission of chosen directory
function check_dir($dir) {
if (!file_exists($dir)) {
if (mkdir($dir, 0777))// create images dir
$done = true;
} else if (!is_writeable($dir)) {
if (chmod($dir, 0777)) // change perm. setting
$done = true;
} else
$done = true;
return $done;
}
No comments:
Post a Comment