Jump to content

Problems Copying File To A Newly Created Directory


TecTao

Recommended Posts

I can not get the copy() function to work.

 

It is a two step process.  First creating a new directory in the root of the web site.  This works fine.  The new directory name is an ID number for a member.  The second step is copying an index.php file from the directory where the page resides that completes this function.  The new directory is passed in the post from a previous page and the index.php file resides in the same directory.

 

code where $webpage is the ID passed from the previous page:

 

$webpage = $_POST[ 'webpage' ];

mkdir("/home/thissite/public_html/thisdomain.com/$webpage");

$NewDirectory = $webpage;

copy('index.php', '/home/thissite/public_html/thisdomain.com/$NewDirectory/index.php');

error_reporting(E_ALL | E_STRICT);

 

I can't really make head or tails of what the error log indicates

 

[26-Jun-2012 11:49:53] PHP Warning:  copy(/home/zipclick/public_html/marketingteammates.com/$NewDirectory/index.php) [<a href='function.copy'>function.copy</a>]: failed to open stream: No such file or directory in /home/zipclick/public_html/marketingteammates.com/_ZABP_merchants/webpage/webpage_enter_submitted.php on line 23

 

Any ideas are greatly appreciated.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.