forked from ChintanNandish/onlineshopmaker_localhost_4
-
Notifications
You must be signed in to change notification settings - Fork 1
/
templatechosen.php
25 lines (25 loc) · 843 Bytes
/
templatechosen.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
session_start();
$choice = $_GET['temp'];
//mkdir("user_folders/chintan_admin/admin-folder");
$src = "templates-to-copy/".$choice;
$dst = "user_folders/".$_SESSION['username'];
recurse_copy($src, $dst);
function recurse_copy($src, $dst){
$dir = opendir($src);
@mkdir($dst);
while(false !== ( $file = readdir($dir)) ) {
if (( $file != '.' ) && ( $file != '..' )) {
if ( is_dir($src . '/' . $file) ) {
recurse_copy($src . '/' . $file,$dst . '/' . $file);
}
else {
copy($src . '/' . $file,$dst . '/' . $file);
}
}
}
closedir($dir);
}
echo "<script>alert('Your website is ready to use. You can download your website after login.');
window.location.href='logout.php';</script>";
?>