Warning: mkdir() [function.mkdir]: File exists in /home/.../verify.php on line 16 i keep getting that error whats the issue? coded used it just mkdir('$name',0777); $name = ucfirst(strtolower($_POST['username-reg'])); PHP: I need this functionally. I cant have all the folder leading to it 0777 and preferable wouldnt like to use the ftp function.
It's giving you an error because the dir already exists. There are also a few mistakes in your code. $name shouldn't be in quotes or it will create the dir $name, not the value that $name refers to .. unless you use " instead of '. You also need to define $name before you try to create that dir or the var will be empty. Try this: $name = ucfirst(strtolower($_POST['username-reg'])); if (is_dir($name)) { mkdir($name, 0777); } PHP: You can set the permissions to whatever you want. You don't have to use 0777 when you create the dir.
You may also want to use ucwords() instead of ucfirst() if $name includes a first and last name or else only the first name will be capitalized.
Also on some server configs you have to make the directory at the default setting of 644 and the chmod it to 777 if that is what you must use. I suggest you try 755 first as it is a bit safer.