techiefreak05 Posted December 5, 2006 Share Posted December 5, 2006 i have the following that creates a folder to store a users image when they register ..:[code]<?php $DIR = "/files/uploads/" .$uname. "/images/";mkdir($DIR)?>[/code]it says something like directory does not exist or something ..."$uname" equals the value of the the username field in my sign up form.I even tried this: [code]<?php mkdir("/files/uploads/" .$_POST[user]. "/images/", 0700);?>[/code]with the same result and no success Link to comment https://forums.phpfreaks.com/topic/29482-mkdir-error-help-please/ Share on other sites More sharing options...
drifter Posted December 5, 2006 Share Posted December 5, 2006 mkdir($_POST[user], 0700); mkdir($_POST[user]. "/images/", 0700);and make sure uploads writeable Link to comment https://forums.phpfreaks.com/topic/29482-mkdir-error-help-please/#findComment-135297 Share on other sites More sharing options...
techiefreak05 Posted December 5, 2006 Author Share Posted December 5, 2006 I tried this: mkdir(files/uploads/$_POST[user], 0700); mkdir($_POST[user]. "/images/", 0700);but it got an error ...why cant i create the dir in uploads?? i did this like 2 weeks ago .. it just stopped working all of a sudden !!! it HAS to be under:: files/uploads/USERNAME Link to comment https://forums.phpfreaks.com/topic/29482-mkdir-error-help-please/#findComment-135299 Share on other sites More sharing options...
drifter Posted December 5, 2006 Share Posted December 5, 2006 well when you create the username dir, do you see it in your file system? Also, try 777 - some hosting companies I have been with have php running under different things such as nobody, I need differnent permissions at different places Link to comment https://forums.phpfreaks.com/topic/29482-mkdir-error-help-please/#findComment-135302 Share on other sites More sharing options...
techiefreak05 Posted December 5, 2006 Author Share Posted December 5, 2006 when i create :: username/images/ folder in the current directorey and not in :: files/uploads .. i can see the :: username/images/ folderNOTICE :::::I can use this and it works fine ::WORKS:<?php mkdir("files/uploads/" .$_POST[user], 0777);?>DOES NOT WORK:<?php mkdir("files/uploads/" .$_POST[user]. "/images/", 0777);?>but i cant add the images folder !! but i need to . cuz soon im gonna add different kinds of uploads ...other than images ....(( I AM HOSTING ALL THIS ON MY OWN COMPUTER)) not an online host. im not done with m site yet so im not yet releasing it. Link to comment https://forums.phpfreaks.com/topic/29482-mkdir-error-help-please/#findComment-135307 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.