Jump to content

[SOLVED] Need to Copy a Directory and all contents in it to another folder


Recommended Posts

Hello, have no script, because have no idea where to start, so I really am looking for some guidance.

 

The title says it all, I have a script that creates a new director for members on first time log in. I now want to copy initially a "Index .php" file in to that folder, then I offer them a choice of five skins, each contained in a separate folder, along with a complete members area.

 

I then need to copy that folder and all sub directories plus file inside that folder to the members folder.

 

I know I can copy files, but find nothing on copying folders, can this be done, if so could someone please point me in the right direction to find out how...

DG

If you are using a Linux server, this might be easier done with exec and use a linux copy command to do it. Save PHP the hassle of what the server can easily do. That is assuming you are not on a shared host that probably disallows the exec command.

This entire approuch seems odd to me. Basically your creating new copies of an application for each new member? Kinda defeats the purpose of creating dynamic web applications.

 

Take a look at this thread to get an idea of where I'm coming from. You should be able to serv all members pages from a single script. No need to reproduce files within different directories.

This entire approuch seems odd to me. Basically your creating new copies of an application for each new member? Kinda defeats the purpose of creating dynamic web applications.

 

Take a look at this thread to get an idea of where I'm coming from. You should be able to serv all members pages from a single script. No need to reproduce files within different directories.

 

Hello,

 

I've only just started to learn php, and really think I'm doing quite well. I now have a members area script that has join, and then sends a confirmation email, containing a link used to activate the account.

 

They are then directed to log-in, at which point another little script checks if it's first time, if so make a directory for them. I can control members, (block, suspend, restrict and remove). I bought a book, (Site Point Build Your own Database Driven Website) It shows you how to build a little joke DB.

 

it doesn't show how to add: Content, and the related (XHTML plus Style-Sheets) then all these in a correct order when a visitor  opens a link on my site.

 

I have some three hundred files and roughly thirty style sheets plus many more XHTML Styles. That would be some DB.

 

I understand where your coming from, but feel it's just a little bit beyond my current abilities.

 

I have set my self a new goal once I've finished the site, that of building my own CMS, I may then be able to run a DB driven Site, but how can you store: SWRF files, graphics, Java Applets, JS and all the different info in a DB, and call it when required?

 

DG

 

 

If you are using a Linux server, this might be easier done with exec and use a linux copy command to do it. Save PHP the hassle of what the server can easily do. That is assuming you are not on a shared host that probably disallows the exec command.

 

I must be honest I know nothing at all about shell commands, I do have full control over my web-space, but don't wish to make a mess of it.

 

I searched the web, but didn't find much on this subject. I think I'll cheat, just place an "index.php" file in each folder and move that into the members folder when called. As long, as all the links are correct, it should work...

 

DG

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.