www.webdeveloper.com
Results 1 to 2 of 2

Thread: Copy file from one directory to another.

  1. #1
    Join Date
    Sep 2012
    Posts
    1

    Copy file from one directory to another.

    I have a user form which I use to create a directory from the name entered on the form. I now need to copy file(s) from a different directory into this new directory. To sum it up, I need this to happen:
    C:/inetpub/wwwroot/one_directory/AAAA/file.php copied to C:/inetpub/wwwroot/one_directory/New_Directory_I_Made . I have listed the code that I am using to make my directory but after much searching and trial and error I have not found any answers.

    <?php
    if (isset($_POST['submit'])) {
    $name = $_POST['comp_name']; // name from form
    mkdir ("c:/inetpub/wwwroot/private/$name");
    mkdir ("c:/inetpub/wwwroot/private/$name/Projects");
    }
    ?>

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,222
    Sounds like a job for copy().
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles