Results 1 to 2 of 2

Thread: Copy file from one directory to another.

  1. #1
    Join Date
    Sep 2012

    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.

    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
    Sounds like a job for copy().
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

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