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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.