stevesimo Posted September 3, 2008 Share Posted September 3, 2008 Hi, I am having trouble with a relatively simple script. There are 3 steps, 1) create a folder 2) chmod folder 3) copy file to new folder Here is my code mkdir('newfolder',0777); //create folder chmod('newfolder', 0777); //chmod folder copy('file.php','/newfolder/file.php') or die('failed to copy file'); Can anyone see what I am doing wrong? thanks, Steve Link to comment https://forums.phpfreaks.com/topic/122545-problem-copying-file/ Share on other sites More sharing options...
BlueSkyIS Posted September 3, 2008 Share Posted September 3, 2008 it may be your destination path. you might want to use the entire path or a relative path: copy('file.php','/newfolder/file.php'); probably should be more like: copy('file.php',$_SERVER['DOCUMENT_ROOT'].'/newfolder/file.php'); // OR copy('file.php','newfolder/file.php'); Link to comment https://forums.phpfreaks.com/topic/122545-problem-copying-file/#findComment-632714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.