I have a folder named data, in which I'd like to create sub-folders on demand.
Below is the code I've put together but so far it won't create the sub-folders; anyone know why?
NOTE: The session variables are defined.
Below is the code I've put together but so far it won't create the sub-folders; anyone know why?
NOTE: The session variables are defined.
session_start();
if (isset($_FILES['imgFile'])){
if ( isset($_SESSION["Id"]) && isset($_SESSION["topicId"]) && isset($_SESSION["topicTitle"]) ){
$newDir = "../data/" . $_SESSION["Id"] . "/topics/" . $_SESSION["topicId"] . "/";
mkdir($newDir, 0777);
$path = $newDir;
}
}
if (isset($_FILES['imgFile'])){
if ( isset($_SESSION["Id"]) && isset($_SESSION["topicId"]) && isset($_SESSION["topicTitle"]) ){
$newDir = "../data/" . $_SESSION["Id"] . "/topics/" . $_SESSION["topicId"] . "/";
mkdir($newDir, 0777);
$path = $newDir;
}
}
Comment