bryanptcs Posted December 14, 2006 Share Posted December 14, 2006 I have a form that is going to be used for clients to submit files to my ftp server. I have their company info being stored in the DB but i want the files to be FTP. I have that portion working correctly. What i need it to do now is create a file named (whatever they type into the business textbox) and upload their files into that directory. Below is the code I have now...but I can't get anything to work like I have described. Thanks for any help.[code]if(!isset($_POST['business'])) { $newdir = "$business";$business = stripslashes($_POST['business']);mkdir("artwork/".$newdir);}[/code] Link to comment https://forums.phpfreaks.com/topic/30671-creating-ftp-folder-based-on-form-variable/ Share on other sites More sharing options...
fizix Posted December 14, 2006 Share Posted December 14, 2006 I think you had some things mixed around... Try this:if(!isset($_POST['business'])) {$business = stripslashes($_POST['business']);mkdir("artwork/".$business);} Link to comment https://forums.phpfreaks.com/topic/30671-creating-ftp-folder-based-on-form-variable/#findComment-141321 Share on other sites More sharing options...
bryanptcs Posted December 14, 2006 Author Share Posted December 14, 2006 I received the following errorWarning: mkdir() [function.mkdir]: File exists in /home/mobile/public_html/procedures.php on line 212except there was no file with the name I tried... Link to comment https://forums.phpfreaks.com/topic/30671-creating-ftp-folder-based-on-form-variable/#findComment-141326 Share on other sites More sharing options...
fizix Posted December 14, 2006 Share Posted December 14, 2006 I haven't worked with FTP in a while but try adding a trailing slash like so:[code]mkdir("artwork/".$newdir."/");[/code] Link to comment https://forums.phpfreaks.com/topic/30671-creating-ftp-folder-based-on-form-variable/#findComment-141330 Share on other sites More sharing options...
marcus Posted December 14, 2006 Share Posted December 14, 2006 You could just do[code]mkdir("artwork/$newdir");[/code] Link to comment https://forums.phpfreaks.com/topic/30671-creating-ftp-folder-based-on-form-variable/#findComment-141344 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.