grandman Posted December 4, 2008 Share Posted December 4, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/135567-solved-need-to-copy-a-directory-and-all-contents-in-it-to-another-folder/ Share on other sites More sharing options...
premiso Posted December 4, 2008 Share Posted December 4, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/135567-solved-need-to-copy-a-directory-and-all-contents-in-it-to-another-folder/#findComment-706247 Share on other sites More sharing options...
trq Posted December 4, 2008 Share Posted December 4, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/135567-solved-need-to-copy-a-directory-and-all-contents-in-it-to-another-folder/#findComment-706318 Share on other sites More sharing options...
grandman Posted December 5, 2008 Author Share Posted December 5, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/135567-solved-need-to-copy-a-directory-and-all-contents-in-it-to-another-folder/#findComment-706642 Share on other sites More sharing options...
grandman Posted December 5, 2008 Author Share Posted December 5, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/135567-solved-need-to-copy-a-directory-and-all-contents-in-it-to-another-folder/#findComment-706645 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.