TechniqueUse PHP's built-in copy() function: <?php if (copy ($original, $new)) { print "$original copied to $new successfully"; } else { print "alas, thine wish cannot be the computers command"; } ?> Or, if you need to move a file, use rename() : <?php rename($original, $new) or die("Cannot Rename"); ?> CommentsThe copy() function takes a source file and a destination file, and copies the source to the destination. If the destination file does not exist, PHP creates it. The rename() function makes a system call to the rename program. |