how to create folder name from user inputs with the folder permissions? if users input the folder name from the form below, i wanna now create the folder from that folder name (if users enters space between the folder name then i want "_" to be included in between the names; like Folder_name) <form id="form1" name="form1" method="post" action="create.php"> <table width="29%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>Name :</td> <td><label> <input type="text" name="name" id="name" /> </label></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="button" id="button" value="Submit" /> </label></td> </tr> </table> </form> Code (markup): could you please help me out??
http://ca.php.net/manual/en/function.mkdir.php <?php mkdir('/path/to/dir/' . str_replace(' ', '_', $_POST['name']), 0777); ?> PHP: Of course you should do more validation that that (in case the user enters a / or other illegal character).
OK thanks for the code, and how would i remove off the unnecessary characters if users input that, and also, how to check if there's already the folder with same name, and show error message...