Results 1 to 2 of 2

Thread: PHP Help - After mkdir, copy a file to new directory

  1. #1
    Join Date
    Apr 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP Help - After mkdir, copy a file to new directory

    Ok, I'm going to use mkdir to make me a folder for my website...and everytime I make a folder, I want it to manually copy a file from a different location in my website, to the new folder I created...(/homepages/21/d748785/htdocs/uploader/index.php)
    Here's the code:
    -----
    $foldername = $_REQUEST['username'];
    if(is_dir("$folder"))
    echo "directory exists!";
    else
    {
    mkdir("./users/$foldername");
    }
    ----

    How would I implement the file copy code into my existing script above?

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Take a look at the PHP Copy() Function.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

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