almightyegg Posted November 3, 2006 Share Posted November 3, 2006 when a new member signs up, they auto receive an id number and i want to automatically create a file:myurl.com/images/players/id/so if there id is 123 then it will bemyurl.com/images/players/123/etc...how would i do this??? i just need a vague idea :) Link to comment https://forums.phpfreaks.com/topic/26104-make-new-directory/ Share on other sites More sharing options...
jpratt Posted November 3, 2006 Share Posted November 3, 2006 mkdir() Link to comment https://forums.phpfreaks.com/topic/26104-make-new-directory/#findComment-119347 Share on other sites More sharing options...
almightyegg Posted November 3, 2006 Author Share Posted November 3, 2006 [code=php:0]if($doublecheck == 0){ echo 'Your account could not be activated!'; } elseif ($doublecheck > 0) { $directory = mkdir("images/player/$userid"); echo 'Your account has been activated! To return to site <a href="http://www.lordoftheabyss.com/index.php">CLICK HERE</a>'; } [/code]comes up with Warning: mkdir(images/player/21) [function.mkdir]: No such file or directory in /home/lordofth/public_html/activate.php on line 27i dontm know why :( Link to comment https://forums.phpfreaks.com/topic/26104-make-new-directory/#findComment-119351 Share on other sites More sharing options...
jpratt Posted November 3, 2006 Share Posted November 3, 2006 try using the complete path. mkdir("/home/lordofth/public_html/images/player/$userid"); Link to comment https://forums.phpfreaks.com/topic/26104-make-new-directory/#findComment-119353 Share on other sites More sharing options...
almightyegg Posted November 3, 2006 Author Share Posted November 3, 2006 Warning: mkdir(/home/lordofth/public_html/images/players/21) [function.mkdir]: Permission denied in /home/lordofth/public_html/activate.php on line 27that makes no sense...why would it be denied :* Link to comment https://forums.phpfreaks.com/topic/26104-make-new-directory/#findComment-119355 Share on other sites More sharing options...
jcbarr Posted November 3, 2006 Share Posted November 3, 2006 Check the permissions on the players directory. Odds are you will need to CHMOD it so that the script has the needed permissions.Do some research on CHMOD though, you want to make sure you set it to just enough permissions, don't ever leave it wide open. Link to comment https://forums.phpfreaks.com/topic/26104-make-new-directory/#findComment-119357 Share on other sites More sharing options...
almightyegg Posted November 4, 2006 Author Share Posted November 4, 2006 anybody have any website suggestions for CHMON and mkdir()??? i searched but i couldnt find anything that was explained in a way a newb could understand :P Link to comment https://forums.phpfreaks.com/topic/26104-make-new-directory/#findComment-119623 Share on other sites More sharing options...
almightyegg Posted November 4, 2006 Author Share Posted November 4, 2006 hmm...i found one that i thought could help...so i changed the file permissions to -rw-rw-rw- but it still shows:Warning: mkdir(/home/lordofth/public_html/images/players/21) [function.mkdir]: Permission denied in /home/lordofth/public_html/activate.php on line 27 Link to comment https://forums.phpfreaks.com/topic/26104-make-new-directory/#findComment-119642 Share on other sites More sharing options...
koencalliauw Posted November 4, 2006 Share Posted November 4, 2006 [quote author=almightyegg link=topic=113778.msg462932#msg462932 date=1162664914]hmm...i found one that i thought could help...so i changed the file permissions to -rw-rw-rw- but it still shows:Warning: mkdir(/home/lordofth/public_html/images/players/21) [function.mkdir]: Permission denied in /home/lordofth/public_html/activate.php on line 27[/quote]You should make sure that safe_mode in your php.ini is turned off if possible. Next you should check that the directory that you want to have write permissions in, has the permissions 775, the owner your user and the group should be the group that runs apache (type 'groups apache' to find out in a terminal). Also, when you are relying on a hosting provider, check with them if they haven't disabled some functions (like mkdir). Link to comment https://forums.phpfreaks.com/topic/26104-make-new-directory/#findComment-119654 Share on other sites More sharing options...
almightyegg Posted November 4, 2006 Author Share Posted November 4, 2006 how does php.ini work....do i have to put code into php files or anything?? Link to comment https://forums.phpfreaks.com/topic/26104-make-new-directory/#findComment-119661 Share on other sites More sharing options...
joshi_v Posted November 6, 2006 Share Posted November 6, 2006 No,Just create a file with the code, then execute in the server where you are facing this problem.[code]<?phpphpinfo();//which will display all the php settings.?>[/code]Regards,Joshi. Link to comment https://forums.phpfreaks.com/topic/26104-make-new-directory/#findComment-120271 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.