Anyone know what I'm doing wrong here? I'm trying to get this code to work so that if a directory exists.. the mkdir() function is bypassed (so i dont get an error) but it seems that no matter what I throw in my is_dir() function it always hops down to the else.
$user = $_POST["user"];
$dirname = "./cp/userfiles/{$user}/";
if (is_dir($dirname)) {
echo "The directory {$user} exists";
} else {
mkdir("userfiles/{$user}", 0777);
echo "The directory {$user} was successfully created.";
}