Lifelesspeople.com

 Forum FAQsForum FAQs  Knowledge BaseKnowledge Base  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   HostingHosting   RegisterRegister 
 DonateDonate   WikiWiki   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

create a directory then copy files to it

 
Lifelesspeople.com Forum Index -> Web Architects' Abode
Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2963
Location: Earth

PostPosted: Mon Dec 31, 2007 10:54 am    Post subject: create a directory then copy files to it Reply with quote

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

PostPosted: Mon Dec 31, 2007 11:17 am    Post subject: Reply with quote

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

PostPosted: Mon Dec 31, 2007 11:33 am    Post subject: Reply with quote

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

PostPosted: Mon Dec 31, 2007 11:58 am    Post subject: Reply with quote

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

PostPosted: Mon Dec 31, 2007 12:00 pm    Post subject: Reply with quote

it was supposed to be stamps, but even after changing it it didn't work. After taking the first / out it started working
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
Display posts from previous:   
Post new topic   Reply to topic    Lifelesspeople.com Forum Index -> Web Architects' Abode All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Home | Hosting | News | Forum | Links | System Status | About | Archive | Donate ]
Powered by phpBB © 2001, 2002 phpBB Group
All trademarks and copyrights on this page are owned by their respective owners. Posts and comments are owned by the poster. Everything else © 2001 - 2007 Lifelesspeople.com