Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Make a folder and copy template files to it with PHP?

Okay.. File IO I'm fine with. I can move them.. but whats the boogering code for making a directory. mkdir() doesn't seem to do it. I have chmodded lucky 7s in the folder in question...

Any takers?

Also.. why would my forms work if I am running them on local-host but fail to work when visited from the outside?

Seriously running out of fingernails to bite....

1 Answer

Relevance
  • IT
    Lv 4
    10 years ago
    Favorite Answer

    This works perfectly on my host:

    <?

    /* wherever this particular script will be installed, I want to create a subfolder */

    /* Step 1. I need to know the absolute path to where I am now, ie where this script is running from...*/

    $thisdir = getcwd();

    /* Step 2. From this folder, I want to create a subfolder called "myfiles". Also, I want to try and make this folder world-writable (CHMOD 0777). Tell me if success or failure... */

    if(mkdir($thisdir ."/myfiles" , 0777))

    {

    echo "Directory has been created successfully...";

    }

    else

    {

    echo "Failed to create directory...";

    }

    ?>

Still have questions? Get your answers by asking now.