Grow your CSS skills. Land your dream job.

mkdir();

  • # July 10, 2009 at 8:05 am

    Hello, i’m trying to create a folder on my server for users as they register, i did some research and found that mkdir seems to be the function that will get this to happen, the problem is that i have no idea how to use it, i looked at the php docs o manual website but i couldnt understnd what everyone was talking about, prehaps someone here can help me.

    Many Thanks
    Chris

    Rob
    # July 10, 2009 at 8:13 pm

    *stabs in the dark*

    <?php mkdir( "myFolder", ’0777′ ); ?>

    this should make a dir called myFolder in probably your root of where this file is ran from – it will give it the folder CHMOD of 0777 which is like read write everyone party time. lol

    do you want to trigger it when something happens? what do you actually want to do?

    # July 12, 2009 at 3:41 pm

    i wanted to create the folder when the person finishes registering with the site, the folder is their name and then I will use php to create some files inside the folder.

    I think your reply helps – I just wanted to know how you use the function.

    Many THanks
    Chris

    Rob
    # July 12, 2009 at 5:21 pm

    ahh cool

    yea I would think it would be something like

    mkdir(‘users/’ . $username, 0777);

    obviously you can pull in the username from whatever they registered, although you might have to do some funky stuff like taking out chars and whatever.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".