treehouse : what would you like to learn today?
Web Design Web Development iOS Development

mkdir doesn't make additional directories

  • I'm trying to make a folder, and then two more folders in that directory. For some reason, it only makes the first folder, but it doesn't make the last two folders.


    mkdir($_SERVER['DOCUMENT_ROOT'] . "/images/gallery/$newdir", true);
    mkdir($_SERVER['DOCUMENT_ROOT'] . "/images/gallery/$newdir/thumb", true);
    mkdir($_SERVER['DOCUMENT_ROOT'] . "/images/gallery/$newdir/full", true);


    Safemode is off.

    EDIT: Nevermind, fixed it.


    mkdir($_SERVER['DOCUMENT_ROOT'] . "/images/gallery/$newdir", 0777, true);
    mkdir($_SERVER['DOCUMENT_ROOT'] . "/images/gallery/$newdir/thumb", 0777, true);
    mkdir($_SERVER['DOCUMENT_ROOT'] . "/images/gallery/$newdir/full", 0777, true);