toter Posted October 14, 2006 Share Posted October 14, 2006 I am trying to copy a file using the copy function and when the page is loaded the coppied file is blank?[code]<?php// set up basic connection$ftp_server = "<host>";$conn_id = ftp_connect($ftp_server);// login with username and password$ftp_user_name = "<username>";$ftp_user_pass = "<password>";$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);// get contents of the current directory$path = $_SERVER['REQUEST_URI'];$path = "public_html" . $path;$contents = ftp_nlist($conn_id, $path);// Create Folder if user wants toif($_POST['action'] == 'Create'){ $dir_name = $path . $_POST['dir_name'] . '/'; ftp_mkdir($conn_id, $dir_name); $template_file = 'ftp://<username>:<password>@<host>/path/to/index.php'; $index_file = 'ftp://<username>:<password>@<host>/' . $dir_name . 'index.php'; copy($template_file,$index_file);}?>[/code]thanks,TT Link to comment https://forums.phpfreaks.com/topic/23948-php-help/ Share on other sites More sharing options...
eswginger Posted October 19, 2006 Share Posted October 19, 2006 bump Link to comment https://forums.phpfreaks.com/topic/23948-php-help/#findComment-111343 Share on other sites More sharing options...
toter Posted October 19, 2006 Author Share Posted October 19, 2006 i am also having trouble with this simple bit of code:[code]<?phpcopy('file.php','newfile.php');?>[/code]i get an error of this:Warning: copy(newfile.php): failed to open stream: Permission denied in /home/<username>/public_html/leaders/tod/copy.php on line 2but all my files and folders permissions are set to 777any body know?thanks a bunch,TT Link to comment https://forums.phpfreaks.com/topic/23948-php-help/#findComment-111348 Share on other sites More sharing options...
toter Posted October 20, 2006 Author Share Posted October 20, 2006 bump Link to comment https://forums.phpfreaks.com/topic/23948-php-help/#findComment-111650 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.