Best unofficial Apache Server developers community |
|
I was wondering how possible it is with PHP to copy a file from one directory on a server and paste it into another. I have a system that when a user registers creates a sub directory called the same as there username, I then want to copy a file called profile.php from a sub directory called users and paste it in the new directory with the name of the user?
posted via StackOverflow
|
|
 
|
You shouldn't do it this way.There must be just one profile.php, serving all users. That's the way how PHP works. It is used to create dynamical sites, producing dynamical content based on user's input. So, based on entered username, it should display particular user's info. One script to serve all users. |
|
 
|
The PHP |
|
 
|
As Col. Shrapnel suggest, you shouldn't copy the profile.php for each user. That will be hard to maintain, and unnecessary duplication. But here's how you can make subdirectories for each of your users.
|