Creating a Folder
Posted: Mon Sep 24, 2007 11:37 pm
Hey Guys,
I have the following code:
What I need to happen is, if it doesn't find the $sectName folder within the $catName folder, it should then create the $sectName folder.
All well in theory, but I get the feeling that the mkdir and file_exists functions, do not use "../" to access one level up. I keep getting "No Such file or directory" errors when using this code.
Also, the $catName folder will always exist, if that matters.
Is there anything I can do to fix the problem?
Thanks.
I have the following code:
Code: Select all
$checkfile = "../" . $catName . "/" . $sectName;
if (!file_exists($checkfile)) {
mkdir($checkfile, 0777);
}All well in theory, but I get the feeling that the mkdir and file_exists functions, do not use "../" to access one level up. I keep getting "No Such file or directory" errors when using this code.
Also, the $catName folder will always exist, if that matters.
Is there anything I can do to fix the problem?
Thanks.