I have a script that allows users to register and have profiles, but I want to add a bit more to it. I am trying to make it so that once they register, I can create a directory inside of the directory named "users", and the new folder will have the name of their username(such as "users/Ascendancy"). And then inside that, I would like to create a PHP file named "index.php" and insert content into that through a variable. I know it's kind of a lot, but any ideas?
Creating and Editing PHP Files On-The-Fly
check out Filesystem functions in php manual, particularly mkdir(), and fwrite() functions
Thanks, I figured out how to do it using those functions. However, I still have just one more question. Is there a way I can check to see if the file and directory are already made, so they don't get over written. Something like an if statement to check if the directory is there or not.
EDIT: Found it, I used is_dir() and it works fine.
7 days later