abdullahc Posted March 7, 2008 Share Posted March 7, 2008 OS: Redhat host: Rackspace PHP version 5.1 framework: codeigniter we are trying to create folders for users to upload photos etc for signed up users. below is the code we are using. Could this be a code issue, we have checked the server folder CHMODs Your thoughts are appreciated and we thank you in advance. 1. we've used chmod -R 0777 users from SSH so that the users directory is writable from script. 2. When someone registers, say with username of phpmaster, a folder is created in the users directory with 0777 permission from code 3. On the subsequent line, another directory is created within users/phpmaster named photo with 0777 permission, from code In the 3rd step the folders are not created at this moment. Here is the code: mkdir($this->config->item('base_path') . '/users/' . $userInfo['username'], 0777); mkdir($this->config->item('base_path') . '/users/' . $userInfo['username'] . '/photo', 0777); Quote Link to comment https://forums.phpfreaks.com/topic/94932-creating-folders-using-php-code-problem/ Share on other sites More sharing options...
raydawg Posted March 7, 2008 Share Posted March 7, 2008 well you dont need to specific 0777 since that is teh default. what error message? if its not working then it has to be throwring a message of some sort. did you echo out the value of $this->config->item('base_path') . '/users/' . $userInfo['username'] to make sure that is actually the correct place? Quote Link to comment https://forums.phpfreaks.com/topic/94932-creating-folders-using-php-code-problem/#findComment-486308 Share on other sites More sharing options...
Daniel0 Posted March 7, 2008 Share Posted March 7, 2008 If you want it to be something like this: http://example.com/users/Daniel0/photo/something.jpg then you're better off using mod_rewrite. Quote Link to comment https://forums.phpfreaks.com/topic/94932-creating-folders-using-php-code-problem/#findComment-486310 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.