Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Regular Coder slappyjaw's Avatar
    Join Date
    Mar 2009
    Location
    Wonderland!
    Posts
    146
    Thanks
    14
    Thanked 3 Times in 3 Posts

    Question PHP directory copy?

    Hey everyone, i was wondering if someone could help me with my website. I am not advanced in php coding. I am tring to make a site like freewebs. i can do everything but the part where someone creates a site. I might be trying to do this wrong but what i did is i tried to make it so that when someone enters the name of their site it duplicates a folder that has the template in it and then renames it to the name of their site, WELL IT DOESNT WORK. so if anyone could give me some help that would be sick. Thanx. Also i will put you in the site credits page cause you helped. Thnx again
    Last edited by Fou-Lu; 03-23-2009 at 03:58 AM.

  • #2
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,294
    Thanks
    4
    Thanked 203 Times in 200 Posts
    Show us the code that you have tried that isn't working as you expect it to.
    Dave .... HostMonster for all of your hosting needs

  • #3
    Regular Coder slappyjaw's Avatar
    Join Date
    Mar 2009
    Location
    Wonderland!
    Posts
    146
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Thanks for the reply. The code did not work because i was tring to copy a folder. But mainly i was wondering if there was easier way to make a page and put iti n a specified folder. This is my code:

    PHP Code:
    <?php
    $sitename 
    $_POST['sitename'];
    mkdir("C:/xampp/htdocs/clansites/".$sitename0777);
    copy("C:/xampp/htdocs/includes/clansite/templates/shelld""C:/xampp/htdocs/clansites/".$sitename);
    ?>
    That's all i have and most of it is either wrong or it isnt the way itproably should. There are nor error messages and there are no if's or and's. Thanks for any help.

  • #4
    Regular Coder sea4me's Avatar
    Join Date
    Jan 2009
    Location
    Damn, I don't know...
    Posts
    390
    Thanks
    11
    Thanked 28 Times in 27 Posts
    I think you have to do it for every file not directory....

    You can get the files in the directory and do a loop for each of the files......

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    I don't believe that PHP has a multiple copy command. I have no idea why it doesn't.
    Here's what you do, create the folder with the mkdir, which is what you're doing.
    Then, you can use a glob or scandir command to read through the files in the templates directory, and run a copy command on each file to copy it to the newly created directory.

    With what you have there, the copy is probably failing since you haven't specified the new name for the file. I'm pretty sure copy needs an actual filename, and not just the path. This is why a glob/scandir method is recommended.
    If the folder is created and the file is not copied over (after the corrections), I'd suspect that the problem is with file permissions on the shelld or templates directory. If it can't be read, it can't be copied, so you'd have to make sure that you're user has at least read privileges.

    Edit:
    Sea4me snuck in there
    I see what you mean there, so I have to ask is the shelld supposed to be a file or directory?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • Users who have thanked Fou-Lu for this post:

    slappyjaw (03-20-2009)

  • #6
    Regular Coder sea4me's Avatar
    Join Date
    Jan 2009
    Location
    Damn, I don't know...
    Posts
    390
    Thanks
    11
    Thanked 28 Times in 27 Posts
    Quote Originally Posted by Fou-Lu View Post
    Edit:
    Sea4me snuck in there
    I see what you mean there, so I have to ask is the shelld supposed to be a file or directory?
    Yes I did but you get the credit since you wrote more and also explained it better

  • Users who have thanked sea4me for this post:

    slappyjaw (03-20-2009)

  • #7
    Regular Coder slappyjaw's Avatar
    Join Date
    Mar 2009
    Location
    Wonderland!
    Posts
    146
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Yes it is a directory. Thank you both for the help. I will make the corrections. I will deff give you both credit for the help.

  • #8
    Regular Coder slappyjaw's Avatar
    Join Date
    Mar 2009
    Location
    Wonderland!
    Posts
    146
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Greate so i still need your help:
    PHP Code:
    <?php
    $sitename 
    $_POST['clanname'];
    $admin $_POST['uname'];
    $password $_POST['password'];
    $dirdest "D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename;
    $dirsource "D:/hshome/rubygirl58/gameparody.com/templates/shelld";
    COPY_RECURSIVE_DIRS($dirsource$dirdest);
    function 
    COPY_RECURSIVE_DIRS($dirsource$dirdest)
    // recursive function to copy
    // all subdirectories and contents:
    if(is_dir($dirsource))$dir_handle=opendir($dirsource);
    mkdir($dirdest0755);
    while(
    $file=readdir($dir_handle))
    {
    if(
    $file!="." && $file!="..")
    {
    if(!
    is_dir($dirsource."/".$file)) copy ($dirsource."/".$file$dirdest."/".$file);
    else 
    COPY_RECURSIVE_DIRS($dirsource."/".$file$dirdest);
    }
    }
    closedir($dir_handle);
    return 
    true;
    }
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/headers"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/news"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/lib"0755);

    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/background.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/banner.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/copyright.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/footer_bg.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/head_bg.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/head_end.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav_bg.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/banner.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/header.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/nav_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/nav_normal.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/header/news.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/header");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/header/team.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/header");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/header/welcome.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/header");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/contact.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/contact_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/forums.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/forums_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/homepage.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/homepage_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/media.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/media_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/news.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/news_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/results.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/results_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/scene.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/scene_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/team.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/team_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/news/soldier.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/news");
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/team"0755);
    ?>
    The script doesnt copy the image files. Can you tell me whats wrong. Do i need an opendir synax? thanx for the help!

  • #9
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    You're copy command still doesn't list the new filename in it.
    ie:
    PHP Code:
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/forums_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav"); 
    This is missing the forums_hover.jpg in the destination directory, or you could rename it to something different.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #10
    Regular Coder slappyjaw's Avatar
    Join Date
    Mar 2009
    Location
    Wonderland!
    Posts
    146
    Thanks
    14
    Thanked 3 Times in 3 Posts
    OH OK. haha sorry. Thnx.

  • #11
    Regular Coder slappyjaw's Avatar
    Join Date
    Mar 2009
    Location
    Wonderland!
    Posts
    146
    Thanks
    14
    Thanked 3 Times in 3 Posts
    ok one last problem i was wondering if anyone could fuse these two scripts to gether so that i can have a self submitting form. So i dont have to change the page.
    PHP Code:
    <?php
    $submitted 
    $_POST['createclan'];
    if (isset(
    $submitted)) {
    $sitename $_POST['clanname'];
    $admin $_POST['uname'];
    $password $_POST['password'];
    $dirdest "D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename;
    $dirsource "D:/hshome/rubygirl58/gameparody.com/templates/shelld";
    COPY_RECURSIVE_DIRS($dirsource$dirdest);
    function 
    COPY_RECURSIVE_DIRS($dirsource$dirdest)
    // recursive function to copy
    // all subdirectories and contents:
    if(is_dir($dirsource))$dir_handle=opendir($dirsource);
    mkdir($dirdest0755);
    while(
    $file=readdir($dir_handle))
    {
    if(
    $file!="." && $file!="..")
    {
    if(!
    is_dir($dirsource."/".$file)) copy ($dirsource."/".$file$dirdest."/".$file);
    else 
    COPY_RECURSIVE_DIRS($dirsource."/".$file$dirdest);
    }
    }
    closedir($dir_handle);
    return 
    true;
    }
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/headers"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/news"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/lib"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/team"0755);

    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/background.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/background.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/banner.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/banner.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/copyright.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/copyright.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/footer_bg.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/footer_bg.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/head_bg.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/head_bg.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/head_end.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/head_end.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav_bg.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav_bg.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/banner.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank/banner.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/header.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank/header.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/nav_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank/nav_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/nav_normal.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank/nav_normal.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/header/news.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/header/news.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/header/team.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/header/team.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/header/welcome.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/header/welcome.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/contact.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/contact.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/contact_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/contact_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/forums.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/forums.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/forums_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/forums_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/homepage.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/homepage.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/homepage_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/homepage_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/media.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/media.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/media_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/media_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/news.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/news.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/news_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/news_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/results.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/results.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/results_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/results_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/scene.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/scene.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/scene_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/scene_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/team.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/team.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/team_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/team_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/news/soldier.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/news/soldier.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/lib/css-reset.css""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/lib/css-reset.css");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/lib/ie6.css""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/lib/ie6.css");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/lib/roster.css""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/lib/roster.css");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/lib/web.css""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/lib/web.css");
    echo 
    '<meta http-equiv="refresh" content="1;URL=<?php echo "http://www.gameparody.com/clansites/$sitename";?>"/>';
    }
    ?>
    Code:
    <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post" name="Form" id="Form">
                                <div class="content22">
                                  <p class="style3">All fields are required!</p>
                                  <table width="100%" border="0">
                                    <tr>
                                      <td width="41%"><div align="right"><span class="style10">Name of clan site:</span></div></td>
                                      <td width="59%"><label>
                                        <input name="clanname" type="text" id="clanname">
                                        </label>
                                          <span class="style7">(Will be URL of site) </span> </td>
                                    </tr>
                                    
                                    <tr>
                                      <td><div align="right" class="style10">Admin Username:</div></td>
                                      <td><label>
                                        <input type="text" name="uname" id="uname">
                                        </label>                                  </td>
                                    </tr>
                                    <tr>
                                      <td><div align="right" class="style10">Admin Password:</div></td>
                                      <td><label>
                                        <input type="text" name="password" id="password">
                                        </label>                                  </td>
                                    </tr>
                                  </table>
                                  <p>
                                    <label>
                                    <input name="createclan" type="submit" id="createclan" value="Create">
                                    </label>
                                    <label>
                                    <input name="reset" type="reset" id="reset" value="Reset">
                                    </label>
                                  </p>
                                </div>
                              </form>
    I tried but i cant get it work.

  • #12
    Regular Coder sea4me's Avatar
    Join Date
    Jan 2009
    Location
    Damn, I don't know...
    Posts
    390
    Thanks
    11
    Thanked 28 Times in 27 Posts
    Try:

    PHP Code:
    <?php
    if (isset($_POST['createclan'])) {
    $sitename $_POST['clanname'];
    $admin $_POST['uname'];
    $password $_POST['password'];
    $dirdest "D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename;
    $dirsource "D:/hshome/rubygirl58/gameparody.com/templates/shelld";

    function 
    COPY_RECURSIVE_DIRS($dirsource$dirdest)
    // recursive function to copy
    // all subdirectories and contents:
    if(is_dir($dirsource))$dir_handle=opendir($dirsource);
    mkdir($dirdest0755);
    while(
    $file=readdir($dir_handle))
    {
    if(
    $file!="." && $file!="..")
    {
    if(!
    is_dir($dirsource."/".$file)) copy ($dirsource."/".$file$dirdest."/".$file);
    else 
    COPY_RECURSIVE_DIRS($dirsource."/".$file$dirdest);
    }
    }
    closedir($dir_handle);
    return 
    true;
    }

    COPY_RECURSIVE_DIRS($dirsource$dirdest);

    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/headers"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/news"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/lib"0755);
    mkdir("D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/team"0755);

    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/background.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/background.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/banner.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/banner.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/copyright.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/copyright.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/footer_bg.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/footer_bg.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/head_bg.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/head_bg.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/head_end.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/head_end.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav_bg.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav_bg.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/banner.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank/banner.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/header.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank/header.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/nav_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank/nav_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/blank/nav_normal.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/blank/nav_normal.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/header/news.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/header/news.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/header/team.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/header/team.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/header/welcome.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/header/welcome.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/contact.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/contact.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/contact_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/contact_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/forums.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/forums.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/forums_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/forums_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/homepage.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/homepage.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/homepage_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/homepage_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/media.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/media.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/media_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/media_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/news.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/news.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/news_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/news_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/results.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/results.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/results_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/results_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/scene.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/scene.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/scene_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/scene_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/team.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/team.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/nav/team_hover.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/nav/team_hover.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/images/news/soldier.jpg""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/images/news/soldier.jpg");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/lib/css-reset.css""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/lib/css-reset.css");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/lib/ie6.css""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/lib/ie6.css");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/lib/roster.css""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/lib/roster.css");
    copy("D:/hshome/rubygirl58/gameparody.com/templates/lib/web.css""D:/hshome/rubygirl58/gameparody.com/clansites/".$sitename."/lib/web.css");

    header"Location: http://www.gameparody.com/clansites/".$sitename ); //redirect to their page
    }
    ?>
    <form id="Form" action="<?php echo $_SERVER['PHP_SELF']?>" method="post" name="Form">
        <div class="content22">
            <p class="style3">All fields are required!</p>
            <table border="0" width="100%">
                <tr>
                    <td width="41%">
                    <div align="right">
                        <span class="style10">Name of clan site:</span></div>
                    </td>
                    <td width="59%"><label>
                    <input id="clanname" name="clanname" type="text"> </label>
                    <span class="style7">(Will be URL of site) </span></td>
                </tr>
                <tr>
                    <td>
                    <div align="right" class="style10">
                        Admin Username:</div>
                    </td>
                    <td><label><input id="uname" name="uname" type="text"> </label>
                    </td>
                </tr>
                <tr>
                    <td>
                    <div align="right" class="style10">
                        Admin Password:</div>
                    </td>
                    <td><label><input id="password" name="password" type="text">
                    </label></td>
                </tr>
            </table>
            <p><label>
            <input id="createclan" name="createclan" type="submit" value="Create">
            </label><label>
            <input id="reset" name="reset" type="reset" value="Reset"> </label></p>
        </div>
    </form>

  • #13
    Regular Coder slappyjaw's Avatar
    Join Date
    Mar 2009
    Location
    Wonderland!
    Posts
    146
    Thanks
    14
    Thanked 3 Times in 3 Posts

    Thumbs up Thanks

    Thanks guys so much! Here is what you have helped me achieve.
    Game Parody Thankyou
    You cant see the clan site thing but if you register it pops up. Now i have to work on the editor for the sites. Also if anyone would like to be a manager if you have spare time. feel free to ask. Thanks
    -Greg

  • #14
    Regular Coder slappyjaw's Avatar
    Join Date
    Mar 2009
    Location
    Wonderland!
    Posts
    146
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Hey how can u change this to resolved?

  • #15
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    Quote Originally Posted by slappyjaw View Post
    Hey how can u change this to resolved?
    Edit the original post and select 'Resolved' from the dropdown near the topic title.
    John


  •  
    Page 1 of 2 12 LastLast

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •