Creating Directories...

They have: 117 posts

Joined: Mar 2000

How do I create a new directory??

--Edge

They have: 117 posts

Joined: Mar 2000

Okay, I found out how to make a directory, but how do I make a directly inside one that already exists and isn't in the same directory as my script?? Also, how do I make new files inside the new directly?

Thanks!

--Edge

They have: 850 posts

Joined: Jul 1999

Wouldn't you just do something like:
$newdir = "images";
$newestdir = "people";
mkdir("$dir",775);
mkdir("$dir/$newestdir",775);

And to make a file in the newest directory, just
open(IN,">/$newdir/$newestdir/file.txt");
close(IN);

------------------
click here to help save lives
http://www.wiredstart.com : The Technology Start Page

They have: 1,587 posts

Joined: Mar 1999

robp is thorough as usual. ur great robp for helping us folks out.

thx

------------------
CLICK 4 some tested resources for making money $, hosting, and web promotions.
My Site got hacked, but i'm coming back?

Traffic-Website.com free traffic, affiliate programs, hosting, & domain names.
My Site got hacked, but i'm coming back?

They have: 117 posts

Joined: Mar 2000

Not quite. It was actually something like:

$dir = "members";
mkdir("$dir",0777);
mkdir("$dir/$FORM{'username'}",0777);

I needed a folder for each person that signed up and the directory permissions were wrong until I added the 0 in front. But now it works! Thanks for helping me figure it out!!

--Edge

They have: 453 posts

Joined: Jan 1999

Ouch!!!!

Never use unchecked user input in a system call !!!

You've just build yourself a big (security-)hole. Just wait for someone to push you into it.

Where are you using this script ?!

ciao
Anti

They have: 117 posts

Joined: Mar 2000

How else would I go about making a directory for each member?

--Edge

They have: 29 posts

Joined: Dec 1999

At least do a filter so they can't type in ../ and anything but letters, _ , and numbers.

Owen

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.