copying files

From: Date: Mon, 26 Jun 2000 14:57:47 +0000
Subject: copying files
Groups: php.general 
Request: Send a blank email to php-general+get-3172@lists.php.net to get a copy of this message
Hi, I have this little piece of code that seems to work fine except it doesn't copy the file. Other than that I know it's getting the filenames cause it prints the, out and it's not have trouble creating the directory either. any suggestions? Thanks //========================================= <?php echo("<B>" . "I am going to move $domain into $newdir" . "</B>"); mkdir("$newdir/$domain", 0770); $directory = opendir("$dir/$domain"); while ($file = readdir($directory)) { if(($file != ".") && ($file != "..")) { copy($file, "$newdir/$domain/" . $file); echo("<B>" . "I moved $file into $newdir/$domain" . "</B>" . "<BR>"); } } http://cleveland.lug.net/~rocket/ The answer is simple if you grant that ironies are like submarines; dangerous only when submerged.

« previous php.general (#3172) next »