I have found several posts about this, and tried several things. Nothing seems to work.
php version: 5.2.9
Apache version: 2.2.11 (Unix)
Trying to check if a directory exists, and if it doesn't, then creating it. Seems simple enough.
Script:
$category =@$_POST['category'];
if(!file_exists($category) && !is_dir($category))
{
mkdir("../../images/$category");
echo "made it";
}
else
{
echo "already exists";
}
The problem is not the creating a directory that doesn't exist, it's if the directory DOES exist, then I get this error:
Warning: mkdir() [function.mkdir]: File exists in /home/account/public_html/beta/admin/upload/browse.php on line 9
made it
Line 9 is mkdir("../../images/$category");
Any help appreciated, thanks.