| Author |
Message |
Desbrina Jadeite

Joined: 11 Jun 2005 Posts: 2963 Location: Earth
|
Posted: Mon Dec 31, 2007 10:54 am Post subject: create a directory then copy files to it |
|
|
I'm a bit confused with the creating a directory part. I believe i need to use http://uk2.php.net/function.mkdir but i'm not sure i have it right, so i just want to check
| Code: | | mkdir('/users/stamp/'.htmlspecialchars($_POST['MemName'].'/', 0777); |
The other thing that i've looked for but haven't had much luck with is copying files from one directory to the newly created one
I have some files stored in scripts/show (1 file, 1 folder), i'd like to be able to copy the file and folder + all files within the folder to the new directory
http://uk3.php.net/copy looks as though it'd work, but i have 29 files to copy, 1 outside of the folder, 28 within it
Whats the best way to go about this? _________________ Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG |
|
| Back to top |
|
| |
LP-SolidRaven Dictator of the Dump

Joined: 06 Jun 2004 Posts: 7036 Location: The cheese is made out of moon
|
Posted: Mon Dec 31, 2007 11:17 am Post subject: |
|
|
Look at the comments on that page about the copy function. A person posted a function to copy directories. _________________
| Quote: |
<bart416> I just realized something
<bart416> we celebrate the fact that this piece of rock made one rotation around a glowing ball of plasma that is kept together due to its own gravity well
<njsg> HAPPY NEW YEAR
<Easter> ^^
|
|
|
| Back to top |
|
| |
Desbrina Jadeite

Joined: 11 Jun 2005 Posts: 2963 Location: Earth
|
Posted: Mon Dec 31, 2007 11:33 am Post subject: |
|
|
i think the copy works, but not the mkdir part
| Quote: | | Warning: mkdir(/users/stamps/Test/) [function.mkdir]: No such file or directory in /usr/home/desbrina/public_html/test.php on line 33 |
the users/stamps exists, and i'm trying to make the Test directory _________________ Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG |
|
| Back to top |
|
| |
LP-SolidRaven Dictator of the Dump

Joined: 06 Jun 2004 Posts: 7036 Location: The cheese is made out of moon
|
Posted: Mon Dec 31, 2007 11:58 am Post subject: |
|
|
Uhm first you use /usrs/stamp/ and than /users/stamps/
Also make sure the stamp or stamps or whatever you want to call it directory already exists. _________________
| Quote: |
<bart416> I just realized something
<bart416> we celebrate the fact that this piece of rock made one rotation around a glowing ball of plasma that is kept together due to its own gravity well
<njsg> HAPPY NEW YEAR
<Easter> ^^
|
|
|
| Back to top |
|
| |
Desbrina Jadeite

Joined: 11 Jun 2005 Posts: 2963 Location: Earth
|
|
| Back to top |
|
| |
|
|
|