So, recently I am working on a small social network, and I stuck at a beginner-fail :(
When a new User is created, a new FOLDER - named like the User - is created in the current folder (/Users). In the current folder(/Users) is also a folder named PATTERN, where a index.php is included.
When a new user is created with mkdir($Username, 0777)
I also want to COPY the index.php from the PATTERN-Folder (/PATTERN) into the new User folder (/$Username).
It just doesn't copy in my tries - how would you do that?
sample:
You can use copy() to copy a file with PHP:
If this does not work, you might have a problem with your code, access rights, or something else. Without your code and the exact description of the error message (if any) it will be hard to help you.
you can use copy function
Docs link: http://www.php.net/manual/en/function.copy.php
you can use copy function in php