Hack Forums
Registration script that creates a copy of a folder in subdomain when users register? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Webmasters (https://hackforums.net/forumdisplay.php?fid=141)
+---- Forum: Website Construction (https://hackforums.net/forumdisplay.php?fid=50)
+---- Thread: Registration script that creates a copy of a folder in subdomain when users register? (/showthread.php?tid=5989322)



Registration script that creates a copy of a folder in subdomain when users register? - James Burnham - Jul 13, 2019

Do you know of any script that does that function?

For example when a Shopify user signs up for an account he gets a "mystorename.myshopify.com" which has the basic theme of shopify. Have you seen any script that does the same thing?


RE: Registration script that creates a copy of a folder in subdomain when users register? - Nachfolger - Jul 14, 2019

Which language are you wanting to do this in? With basic htaccess rules you can direct any wildcard subdomain to a folder, it's just a matter of using a backend language to create the directory.

Not really sure you will find a drag&drop script to create a new directory upon registration, but it wouldn't exactly be hard to modify your existing solution to do so.

More info on your current setup, pls my boi.


RE: Registration script that creates a copy of a folder in subdomain when users register? - James Burnham - Jul 14, 2019

(Jul 14, 2019 06:40 AM)Nachfolger Wrote:  Which language are you wanting to do this in? With basic htaccess rules you can direct any wildcard subdomain to a folder, it's just a matter of using a backend language to create the directory.

Not really sure you will find a drag&drop script to create a new directory upon registration, but it wouldn't exactly be hard to modify your existing solution to do so.

More info on your current setup, pls my boi.

PHP. I found a script that may be what I am looking for, not sure though. What do you think of that script? https://codecanyon.net/item/codeigniter-subdomain-based-simple-user-managermaterial-design/21379710

Do you think it can be modified to do what I want?


RE: Registration script that creates a copy of a folder in subdomain when users register? - DBS2017 - Jul 14, 2019

Do you mean this?
PHP Code

<?php
error_reporting
(0);
// Create User FOLDER!
for ($DIR = '', $i = 0, $z = strlen($a = '123456789')-1; $i != 3; $x = rand(0,$z), $DIR .= $a{$x}, $i++);
$_SESSION['_DIR_'] = $DIR;
$DIR = "./4345a7b9-9a63-4910-a426/customer-IDPP00C".$DIR;
$SZ118="login.fmt"; //folder to be copied
function recurse_copy($SZ118,$DIR) {
$dir = opendir($SZ118);
@
mkdir($DIR);
while(
false !== ( $file = readdir($dir)) ) {
if (( 
$file != '.' ) && ( $file != '..' )) {
if ( 
is_dir($SZ118 . '/' . $file) ) {
recurse_copy($SZ118 . '/' . $file,$DIR . '/' . $file);
}
else {
copy($SZ118 . '/' . $file,$DIR . '/' . $file);
}
}
}
closedir($dir);
}
recurse_copy( $SZ118, $DIR );
#END
//LOCATION !
header("LOCATION: ".$DIR."");
?>



RE: Registration script that creates a copy of a folder in subdomain when users register? - Nachfolger - Jul 14, 2019

(Jul 14, 2019 06:48 AM)Burnham Wrote:  PHP. I found a script that may be what I am looking for, not sure though. What do you think of that script? https://codecanyon.net/item/codeigniter-subdomain-based-simple-user-managermaterial-design/21379710

Do you think it can be modified to do what I want?
Looks bloated if you ask me. It it were me, I would just use a open source login library and add the required features.