I'm trying to create a new directory. Here is my code:
$path="/home/[username]/public_html/$section/$category";
if (!file_exists($path)) {
echo "Directory added.";
} else {
die("Could not create directory.";
}
Guess what output I get?
I confirmed with my host that that's the correct path to use and I'm not trying to create directories that already exist. Also, the 2 variables do contain values, it's not trying to create directories that start with dollar signs.
Where did I go wrong? Is there a way to get PHP to tell me what the error is (something like mysql_error())?
Thanks for your help.