Horse Posted September 5, 2008 Share Posted September 5, 2008 Hi All, I've had a look around but can't find any help with this so hopefully someone here will be able to help! I have a site that users can sign up to get their own 'personal area'. This involves me uploading a load of files & folders via ftp and creating a database for each user which is taking a LOT of time. I'm sure there must be a way to automate this using php? So when a user signs up the files are copied from another location to a new folder named whatever they choose for their username. I think the creation of the new database may need some integration with my web host? Even if I can get the files automatically copying for now that will be reducing the time I spend creating the new accounts by about 50% which will be a big help! Thanks in advance for any help with this!!! Link to comment https://forums.phpfreaks.com/topic/122844-php-to-automate-file-copy-database-creation/ Share on other sites More sharing options...
ranjuvs Posted September 5, 2008 Share Posted September 5, 2008 For copying files use copy command. For creating database use code like $query = "CREATE DATABASE phpdb"; $result = mysql_query($query); Link to comment https://forums.phpfreaks.com/topic/122844-php-to-automate-file-copy-database-creation/#findComment-634411 Share on other sites More sharing options...
Horse Posted September 5, 2008 Author Share Posted September 5, 2008 Thanks ranjuvs! Do you know how I would automatically create the new folder based on the username they have chosen? Link to comment https://forums.phpfreaks.com/topic/122844-php-to-automate-file-copy-database-creation/#findComment-634425 Share on other sites More sharing options...
ranjuvs Posted September 5, 2008 Share Posted September 5, 2008 use mkdir() function Link to comment https://forums.phpfreaks.com/topic/122844-php-to-automate-file-copy-database-creation/#findComment-634427 Share on other sites More sharing options...
ranjuvs Posted September 5, 2008 Share Posted September 5, 2008 $username = $_POST['username']; mkdir("/path/to/dir".$username, 0777); Link to comment https://forums.phpfreaks.com/topic/122844-php-to-automate-file-copy-database-creation/#findComment-634429 Share on other sites More sharing options...
Horse Posted September 5, 2008 Author Share Posted September 5, 2008 Great, thanks for your help. I'll give this a try over the next few days and report back. Link to comment https://forums.phpfreaks.com/topic/122844-php-to-automate-file-copy-database-creation/#findComment-634433 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.