My post title may be a little misleading but what I want to be able to do two things with this.
One create a new directory, and within the directory that has been created, create 3 more folders.
So lets say I have a register form on my website right, I want it so that when the user clicks the submit button (register), it creates a folder with their name/username, and within that folder that has been created with their name/username 3 more folders are created inside, i.e. folder1, folder2, folder3.
So now when I look on my server it would say my username: admin33 and within admin33 I have folder1, folder2, folder3.
What I want to know is, is there someway to do that?
I have this code that makes the directory, but then my brain shuts down when I want to modify it and make those other 3 foldersā¦
This works fantastically well, but how would I make it so that the folders have different names
so for example: youtube, google,and sitepoint, would be the folder names instead of folder1, folder2, folder3
To eliminate possible errors which may occur when using mkdir(ā¦);, try using is_dir(ā¦) to ensure the proposed new directory does not already exist.
donāt use statements like that - either just reference $_POST[foldername'] everywhere and donāt create $foldername as an alias for it at all or VALIDATE the content of $_POST[foldername'] so that you know that $foldername contains a valid folder name and not anything at all.