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] Quote Link to comment 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);} Quote Link to comment 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... Quote Link to comment 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] Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.